byte swap · little ↔ big endian · hex input · live

Swap endianness on hex bytes

Reverse the byte order of a hex string. Spaces, commas, 0x and \\x prefixes are accepted — paste anything from a memory dump or wire log.

Endianness Converter
Input
11 B
1 lines
Output
11 B
1 lines
Status
ready
live
Ratio
1.00×
out/in
input · hex bytes
output · swapped
78 56 34 12
Quick Start

How byte reversal works

The input is sanitised down to raw hex digits, split into byte pairs and reversed. A 32-bit little-endian word 12 34 56 78 becomes the big-endian 78 56 34 12.

  1. 01

    Paste hex

    Mixed formats welcome — spaces, commas, 0x and \\x prefixes are stripped.

    Parsing is strict-but-tolerant — comments and trailing commas are accepted on input where the source format historically permits them; output stays canonical.

    inputstricttolerantliveparse
    in · sourcehex · live
    0x12 0x34 0x56 0x78
    loaded · parsedtarget · ready
  2. 02

    Validate length

    An even number of hex digits is required so the bytes split cleanly.

    Conversion preserves type information where the target supports it (numbers stay numeric, booleans stay boolean) so the destination parser never has to re-coerce.

    checktype-preservinglosslesslivememoised
    len · optionseven · live
    8 hex digits → 4 bytes
    options applied · liveround-trip
  3. 03

    Reverse bytes

    Each two-digit byte becomes one element of an array, then the order is flipped.

    Re-encoding is idempotent: running output back through the same converter produces the same bytes, which keeps round-trips git-friendly.

    swapidempotentround-tripdiff-cleandeterministic
    rev · convertedorder · ready
    [12,34,56,78] → [78,56,34,12]
    converted · livediff-clean
  4. 04

    Copy bytes

    Output is space-separated bytes — drop straight into a hex viewer or test fixture.

    Copy writes via navigator.clipboard.writeText; downloads use the target’s native MIME so editors apply the right syntax highlighting on open.

    exportclipboardtarget MIMEblobclient-side
    ✓ · copiedready · done
    ✓ Copied
    shipped · ready to shipsuccess
Pro tips

Converting between formats, safely

Pick the strictest source format

Lossy formats hide bugs. Choose JSON or YAML as your source-of-truth, convert downstream as needed.

Round-trip in CI

If your converter is idempotent, your CI can verify A → B → A equals the original. Catches subtle data loss.

Numbers vs strings differ

YAML/TOML have a number type; CSV doesn’t. Quote IDs in CSV to keep leading-zero values intact.

Watch character encoding

Source format may be Latin-1 / Windows-1252; target should be UTF-8. Convert encoding before structure.

Preserve comments where you can

YAML and TOML support comments. Don’t silently drop them — they often encode intent.

Schema-aware beats blind

Use a schema to guide conversion. Field types, required-ness, and defaults survive better with structure.

Use Cases

When to swap endianness

Embedded, networking, binary protocols.

Embedded development

Match ARM little-endian memory to a big-endian network value. Type information survives: numbers stay numeric, booleans stay boolean, strings stay strings. The destination parser doesn't have to re-coerce, which avoids the "'true' becomes "true"" bug class.

round-trip safe

Binary protocol parsing

Wire formats are usually big-endian; native ints are usually little. Run output back through the inverse converter to verify idempotent round-trips in CI. A → B → A should produce byte-identical input — if it doesn't, you've found data loss.

type-preserving

File format hacking

BMP, ZIP and PCAP all mix byte orders — swap fields by hand. Comments and metadata survive where the target format supports them (YAML, TOML, HCL). The tool doesn't silently drop intent-encoded annotations, which keeps your config self-documenting.

schema-aware

GPU / SIMD work

Pack words for AVX/NEON registers in the right order. Pair with a schema (JSON Schema, OpenAPI, Zod, Pydantic) to catch shape drift on either side. Catch breaking changes at conversion time rather than at runtime in production.

lossless

Debugging captures

Reverse a four-byte timestamp to match the source machine. Output respects target-format conventions: quoting in CSV, indent in YAML, brackets in JSON. Existing parsers don't need patches, and the result drops into legacy pipelines unchanged.

diff-clean

Cross-arch porting

Move binary blobs between x86 and big-endian PowerPC builds. Encoding-aware: handles UTF-8 vs UTF-16 vs Latin-1 / Windows-1252 transparently. The character-set surprise that breaks "works on my machine" doesn't apply here.

spec-grade
FAQ

Frequently asked questions

Any even-length hex string works — the tool reverses byte order, not word order, so any width is supported.
The input contained non-hex characters or had an odd length. The error panel shows which check failed.
For arbitrary chunk sizes split the input into groups of N bytes first, then swap each group.
Use the IEEE 754 converter for float ↔ hex conversion; pair the two tools to swap a float's bytes.
No. Conversion runs locally in your browser.
Suggest a tool

Something missing?

Tell us what you need. We ship the top requests every two weeks.

Sent straight to the maintainers · no account needed
47 in queue·8 shipped this month
Request queued. Thanks!