Hex Formatter

This free hex formatter restyles any hexadecimal string exactly the way you need it: choose a prefix, separator, letter case, and grouping size. The formatted output updates live, ready to copy into code, CSS, or documentation.

What the Formatting Options Do

Different tools and languages expect hex values in different forms. A 0x prefix marks a hex literal in many programming languages, while # is used for CSS colors and \x for C string escapes. This formatter lets you add any of those prefixes without editing by hand.

You can also control the separator between byte groups, switch between uppercase and lowercase letters, and set the grouping size. For example, the raw hex FF5733AABBCCDD can become 0x:FF57:33AA:BBCC:DD with a colon separator and group size of four.

  • Prefix options: none, 0x, #, or \x.
  • Separator options: none, space, colon, or dash.
  • Case options: uppercase or lowercase letters.
  • Grouping options: every 2, 4, or 8 characters.

Why Format Hex Strings

Consistent formatting makes hex data easier to read and debug. Grouping bytes visually matches how memory is organized, and standard prefixes prevent ambiguity about the base of a number.

Use this hex string formatter whenever you need to adapt raw hex output to a particular language or convention.