Byte radix and endianness converter
Convert bytes between hex, binary, octal, unsigned or signed decimal, Base64 and UTF-8 text, and swap byte order between big and little endian in 2, 4 or 8-byte words.
Process locally
Files stay in this browser session. Closing or clearing releases them.
Add text
Type or paste the text to process
Adjust settings
Optional: Input, Output, Byte order and more
Run
Processes in this browser; cancel at any time
About this tool
Convert bytes between hex, binary, octal, decimal, Base64 and UTF-8 text, and swap between big and little endian. Use it while debugging a serial port, a network protocol or embedded data: read a hex dump as signed decimals, flip little-endian words, or turn bytes into an array for your code.
Hex input may use 0x, \x or % prefixes and separators such as spaces, commas and colons, and decimal input may mix signed and unsigned bytes from −128 to 255. Up to 1 MB of text is converted in your browser without being uploaded.
How to use it
- Type or paste the bytes, or select Use example to load some hex.
- Choose the “Input” and “Output” formats, for example from “Hex” to “Signed decimal (−128–127)”.
- To change endianness, pick an option under “Byte order”, such as “Swap every 4 bytes (32-bit)” or “Reverse all bytes”. Then choose a “Separator”.
- Select Run, then preview the result and download it as a text file.
Formats and limits
- Input
- Text
- Output
- Plain text
- Size limit
- 1 MB
- Settings
- Input (Hex, Binary, Octal, Decimal, Base64, Text); Output (Hex, Binary, Octal, Unsigned decimal, Signed decimal, Base64, Text); Byte order (Swap every 2 bytes, Swap every 4 bytes, Swap every 8 bytes, Keep, Reverse all bytes); Separator (Space, Comma, None, One per line, Array, such as [0x01, 0x02])
- Privacy
- Files stay in the current browser session. No file bytes are uploaded.
- Price
- Free, no sign-up
Common questions
Why does hex FF become -1 as a signed decimal?
“Signed decimal (−128–127)” reads each byte as two’s complement, so 80 to FF become -128 to -1. Choose “Unsigned decimal (0–255)” for values from 0 to 255.
How do I swap endianness?
Choose the word size under “Byte order”: “Swap every 4 bytes (32-bit)” turns 12 34 56 78 into 78 56 34 12. The number of bytes must be a multiple of the word size, or the run stops with an error. “Reverse all bytes” flips the whole sequence.
Can I paste an array from code?
For decimal, binary and octal, yes: surrounding [ ], { } or ( ) are ignored, and values can be separated by spaces, commas or semicolons. Hex can be written as 0x12, 0x34 but without the brackets. Binary with no separators is read 8 bits at a time.
Why does converting to text fail?
“Text (UTF-8)” needs valid UTF-8 bytes, so bytes in GBK or another character set are rejected. Use the “Character set encoding and mojibake repair” tool for those.
What does the array output look like?
With “Array, such as [0x01, 0x02]”, hex, binary and octal values get a 0x, 0b or 0o prefix, decimal values get none, and the list is wrapped in square brackets, ready to paste into code. Base64 and text output ignore the separator.
Related tools
File to hex
Show any file as hex: a hexdump with offsets and an ASCII preview, plain hex, or a C byte array.
Number base converter
Convert integers of any size between bases 2 and 36, one per line, with optional two’s complement for signed 8 to 128-bit values.
IEEE 754 float converter
Show the single or double-precision bits of decimal numbers, or read hex and binary bit patterns back as numbers, one per line.
Character set encoding and mojibake repair
Show the bytes of text in UTF-8, GBK, GB18030, Big5, Shift_JIS and more as hex, turn hex back into text, or repair mojibake from text read in the wrong character set.
Encode and decode text
Encode or decode Base64, Base64URL, URL, hexadecimal or HTML entities. Encoding is not encryption.
Sign-magnitude, ones’ and two’s complement
Sign-magnitude, ones’ complement and two’s complement of decimal integers, one per line, at 8, 16, 32 or 64 bits.