Hex Editor and Binary Viewer

Open a file or paste hex to see its bytes as hex, binary, UTF-8 text and a classic offset dump with an ASCII column. Files never leave your browser.

The interactive tool loads here when JavaScript runs.

About this tool

What is the Hex Editor?

The Hex Editor shows the raw bytes of a file or a snippet of data four ways at once: space-separated hex, 8-bit binary, editable text, and a formatted dump with offsets and an ASCII column, the same layout hexdump -C and xxd print. Upload a file with Upload File, or type hex or text and the other views update as you type.

Hex you type is checked as you go. An odd number of digits or a character that is not 0 to 9 or A to F shows an error instead of being guessed at, and the other views keep the last valid bytes. Text you type is stored as UTF-8, so é becomes C3 A9 and an emoji becomes four bytes.

It is a viewer and byte editor for small to medium files, not a full disk editor. Every view is rebuilt from the whole buffer on each edit, so files of a few megabytes are fine but very large binaries will feel slow. The Download Hex button saves the hex text, not a rebuilt binary file.

  • Hex, binary, editable text and offset dump views of the same bytes
  • Validates hex input and reports odd lengths and bad characters
  • Text is encoded as UTF-8, with a lossy-view warning for binary data
  • Accepts spaced, packed, comma-separated and 0x-prefixed hex
  • Files are read locally in your browser and never uploaded
Read the guide: How to Read a Hex Dump: Offsets, Bytes and Magic Numbers

Updated

How to use the Hex Editor

  1. Click Upload File to load any file, or Sample Data to start with a short string. Nothing is uploaded; the file is read by your browser.
  2. Edit bytes in the Hex View tab. Spaces, line breaks, commas and 0x prefixes are all accepted, so 48 65 6C, 48656C and 0x48,0x65,0x6C mean the same thing.
  3. Use the Text View tab to type or paste text. It is converted to UTF-8 bytes, and the Hex and Binary views follow.
  4. Open Formatted Hex for the offset and ASCII dump, and Binary View for the bits of each byte.
  5. Copy any view with its copy button, or click Download Hex to save the hex text as hex-dump.txt.

Worked examples

A short ASCII string

Input

Hello, World!

Output

00000000: 48 65 6C 6C 6F 2C 20 57 6F 72 6C 64 21          |Hello, World!|

Thirteen characters, thirteen bytes. The hex column is padded to the width of 16 bytes so the ASCII gutter lines up on every row.

Non-ASCII text in the dump

Input

café ☕ followed by a newline

Output

00000000: 63 61 66 C3 A9 20 E2 98 95 0A                   |caf.. ....|

é is two UTF-8 bytes (C3 A9) and the coffee cup is three (E2 98 95), so the line is 10 bytes for 7 characters. Every byte outside 0x20 to 0x7E, including the newline 0A, prints as a dot.

Background and insight

A hex dump is the oldest debugging view in computing. Each byte is two hex digits because 16 squared is 256, exactly the number of values a byte can hold. The classic layout puts 16 bytes on a line, an offset on the left in hex (so the second line starts at 00000010, which is byte 16), and a gutter on the right that prints bytes 0x20 to 0x7E as ASCII and everything else as a dot.

Most file formats announce themselves in their first few bytes, which is why a hex view is the fastest way to answer "what is this file really?". PNG files start 89 50 4E 47, PDFs start 25 50 44 46 (%PDF), ZIP and DOCX files start 50 4B (PK), gzip starts 1F 8B, and Parquet files begin and end with 50 41 52 31 (PAR1). A UTF-8 byte order mark is EF BB BF, and it explains a surprising number of "invisible character" bugs in CSV and JSON files.

The ASCII column is deliberately lossy. A dot can be a null byte, a newline, a byte above 0x7F or part of a multi-byte UTF-8 character. When you need to know which, read the hex. That is also why this tool switches the Text view to a dotted, lossy display (with a warning) when the bytes are not clean UTF-8 text: editing there would overwrite the bytes the dots stand for.

Common use cases

  • Identifying a mystery file

    Check the magic bytes at offset 0 to tell whether a file with the wrong extension is really a PNG, ZIP, gzip or PDF.

  • Finding invisible characters

    Spot a UTF-8 BOM (EF BB BF), a non-breaking space (C2 A0) or Windows line endings (0D 0A) that break a parser.

  • Building test payloads

    Type exact bytes for a protocol test or a fuzzing seed and copy them out as hex or binary.

  • Learning encodings

    Type text in different scripts and watch how many bytes each character takes in UTF-8.

Tips and limitations

  • If the Text view shows a warning about dots, edit in Hex View instead. Typing in the dotted text replaces every hidden byte with 2E, the code for a period.
  • An "odd number of hex digits" error usually means a missing leading zero: write 0A, not A.
  • Offsets are hex. Line 00000100 starts at byte 256, not byte 100.
  • The dump shows bytes, not characters. A line of 16 bytes may hold fewer than 16 characters of non-English text.
  • Large files work but every edit rebuilds all views, so trim big binaries to the region you care about first.

Sources and further reading

  1. Portable Network Graphics, Library of Congress. Format description with PNG's signature bytes, 89 50 4E 47
  2. RFC 1952: GZIP file format specification version 4.3, Internet Engineering Task Force. Defines the gzip magic bytes 1F 8B
  3. .ZIP File Format Specification (APPNOTE.TXT), PKWARE. The PK signatures at the start of ZIP and DOCX files
  4. File Format, Apache Parquet. The PAR1 magic number at both ends of a Parquet file
  5. FAQ: UTF-8, UTF-16, UTF-32 and BOM, Unicode Consortium. Why a UTF-8 file may start with EF BB BF

Frequently asked questions

How do I view a file in hex online without uploading it?

Click Upload File and pick the file. Despite the button name, the file is read by your browser with the FileReader API and never sent to a server. The Hex View, Binary View and Formatted Hex tabs then show its bytes.

Why does the ASCII column show dots instead of letters?

The ASCII column only prints bytes 0x20 to 0x7E, the printable ASCII range. Control characters such as newline (0A), bytes above 0x7F and each byte of a multi-byte UTF-8 character are shown as dots. Read the hex column to see the actual values.

Why is é two bytes in the hex view?

Text is stored as UTF-8, where every character above U+007F takes two to four bytes. é is U+00E9, which UTF-8 encodes as C3 A9. In the older Latin-1 encoding it would be the single byte E9, which is why mixing the two produces garbled text.

What does an odd number of hex digits mean?

Each byte is exactly two hex digits, so an odd count means one byte is incomplete. The editor stops and shows an error rather than guessing whether you meant 0A or A0. Add the missing digit, usually a leading zero.

Can I save the edited bytes back to a binary file?

Not directly. Download Hex saves the hex as a text file. To turn it back into a binary, run xxd -r -p hex-dump.txt out.bin on Linux or macOS, which reads plain hex and writes the bytes.

How do I recognise a file type from its first bytes?

Look at offset 0 in the formatted dump. Common signatures are 89 50 4E 47 for PNG, FF D8 FF for JPEG, 25 50 44 46 for PDF, 50 4B 03 04 for ZIP-based formats like DOCX and JAR, and 1F 8B for gzip.

Is there an in-depth guide to the Hex Editor?

Yes. “How to Read a Hex Dump: Offsets, Bytes and Magic Numbers” covers the background, how it works, common pitfalls and worked examples. Read the full guide.