YourTools.
简体中文
Back to the catalog
Tools

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

Byte radix and endianness converter

Run

Processes in this browser; cancel at any time

Add text first

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

  1. Type or paste the bytes, or select Use example to load some hex.
  2. Choose the “Input” and “Output” formats, for example from “Hex” to “Signed decimal (−128–127)”.
  3. 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”.
  4. 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.