Hex Converter
Convert text to hex bytes and back, or decimal to hexadecimal — exact at any size, thanks to big-integer math.
Result
About this tool
Hexadecimal is the way software talks about bytes: base-16, where each pair of digits (00 to ff) represents exactly one byte. It appears everywhere in technical work — color codes, memory dumps, MAC addresses, binary file headers, hash outputs, escape sequences — and converting between hex and human-readable forms is a daily micro-task this tool makes instant.
Two modes cover the two different questions people mean by "hex conversion." Text mode converts a string to its UTF-8 bytes as hex pairs and back — paste "Hello", get 48 65 6c 6c 6f; paste a hex dump, recover the text. Decoding is deliberately tolerant: spaces, newlines and 0x prefixes are all ignored, so hex copied from any source just works. Number mode converts between decimal and hexadecimal in both directions, live, as you edit either field.
The number mode has one property worth calling out: it uses big-integer arithmetic, so conversion is exact at any size. Most online converters silently corrupt numbers above 9,007,199,254,740,991 (JavaScript's float precision limit) — a real problem when converting database IDs, timestamps in nanoseconds, or cryptographic values. Here, a 40-digit number converts as precisely as a 4-digit one. Entirely in your browser, both directions, no limits.
How to use the Hex Converter
- 1Pick a mode: Text ↔ Hex for strings and byte dumps, Number ↔ Hex for values.
- 2In text mode, choose direction and paste — decoding tolerates spaces, newlines and 0x prefixes.
- 3In number mode, edit either the decimal or hex field; the other converts live.
- 4Copy the result.
Frequently asked questions
Why does one character become two hex digits?
Each byte (8 bits) is written as exactly two hex digits (00–ff). ASCII characters are one byte, so 'H' becomes 48. Characters beyond ASCII use multiple bytes in UTF-8 — é becomes c3 a9, and emoji take four bytes.
What does the 0x prefix mean?
It's the programming convention marking a number as hexadecimal — 0xff means hex ff (255), distinguishing it from a decimal 'ff' typo. This tool's decoder strips 0x automatically, so pasting prefixed values just works.
Why do other converters give wrong answers for huge numbers?
JavaScript's standard numbers are floats with exact precision only up to 2^53 (about 9 quadrillion). Beyond that, naive converters silently round. This tool uses BigInt arithmetic, which is exact at any length — important for IDs, hashes and timestamps.
Is this the same as a hex color code?
Same notation, specific meaning: #6D5BFF is three hex bytes for red (6D), green (5B) and blue (FF). For color work specifically, the Color Converter tool on this site translates hex to RGB and HSL.
Related tools
Binary Converter
Text to binary and back, or decimal to binary — 8-bit bytes, exact big-integer math.
Open toolBase64 Encode / Decode
Convert text to Base64 and back — UTF-8 safe, so emoji and non-English characters survive.
Open toolHEX / RGB / HSL Converter
Paste a color in any format — HEX, rgb() or hsl() — and get all three, instantly.
Open toolHash Generator
Generate MD5, SHA-1, SHA-256 and SHA-512 hashes from any text — live, locally, all four at once.
Open tool