Number Base Converter
Convert the same integer between any source radix and any target radix from 2 to 36, right in the browser. The source radix is set in a single input, with an optional toggle to auto-detect 0x, 0o, and 0b prefixes. Binary, octal, decimal, and hex are listed by default, but every target row can be removed and any other radix added on demand. A separate bit view tab adds an interactive bit grid, bit stats, 8 to 64 bit two complement views, and big-endian / little-endian byte order — useful for bit-level debugging, protocol fields, embedded register lookups, algorithm practice, and database ID inspection. Everything runs locally; nothing leaves your machine.
- Pick any source radix 2 to 36 and any number of target radixes
- Default targets are 2, 8, 10, 16 — drop the ones you do not need, add any other base on demand
- Click a bit in the grid to flip it and watch the source value rewrite in place
- Two complement views at 8, 16, 32, and 64 bits, plus big-endian and little-endian byte order
- BigInt math handles 64-bit-plus values, Snowflake IDs, and UUID high bits without truncation
When on, a 0x, 0o, 0b, or # prefix overrides the radix you set here.
Allowed characters: 0–9 and a–z, plus spaces or underscores for grouping and a leading minus sign.
Add or remove any radix 2–36; keep at least one. Each row appears as Base N.
Overview
Converting the same integer between two arbitrary bases comes up in bitwise debugging, register reads, binary protocol inspection, design-doc cross-checks, and algorithm work. Combining a flexible target list with an interactive bit grid, two complement, and byte order removes the back-and-forth between scattered calculators.
- 01
Source and target bases both arbitrary
Both the source and target radix accept any integer from 2 to 36. Binary, octal, decimal, and hex are listed by default; you can also add bases like 7, 12, 20, or 36.
- 02
Targets you can add or remove
Show only the bases you care about. Drop the ones you do not need; bring back the ones you do. Every target row updates live as you type.
- 03
Interactive bit grid
In the bit view, the value lays out bit by bit. Click any cell to flip it and the source input rewrites itself in place — far faster than mental masking and a re-edit.
- 04
Two complement at 8 to 64 bits
Pick a width in the bit view and the tool shows both unsigned and signed interpretations together — the form register manuals, protocol specs, and system APIs actually use.
- 05
Big-endian and little-endian preview
Slice the chosen width into bytes and read them back in BE and LE order to confirm network byte order, file headers, and cross-arch memory layouts.
- 06
Local-first, nothing uploaded
Parsing, conversion, and bit operations all run in the browser, which keeps internal register values, undisclosed protocol fields, and debug snapshots local.
How to use
From setting the source radix to managing target bases and interactively flipping bits, the whole flow lives in a single panel.
- 01
Set the source radix on the left, or turn on Detect 0x / 0o / 0b prefixes to let the prefix decide.
- 02
Paste the value in the input below. The tool validates it against the source base as you type.
- 03
Under the Results tab, the common 2, 8, 10, 16 bases are listed by default. Add other radixes from the input next to Add target base, or click the × on a chip to drop one.
- 04
Switch to the Bit view tab to flip bits; pick an 8, 16, 32, or 64 bit width to view two complement and byte order layouts.
- 05
Use the per-row copy button to take the formatted value into code, docs, or tickets — no extra prefix or padding to clean up.
Details
One panel covers arbitrary-base conversion, bit-length lookup, prefix formatting, visual bit debugging, and byte-order inspection.
- Source and target bases both accept any radix from 2 to 36
- Default targets are 2, 8, 10, 16, and every row can be added or removed
- Interactive bit grid — click a bit to flip it and rewrite the source value
- Bit stats: set-bit count, leading zeros, trailing zeros, and most significant bit
- 8, 16, 32, and 64 bit two complement views with signed and unsigned interpretations
- Big-endian and little-endian byte order preview for protocol and binary layouts
- Detect 0x / 0o / 0b prefixes when enabled, including 0X, 0O, 0B, and #
- BigInt math that handles 64-bit and larger integers without rounding
- Negative numbers entered and displayed with a leading minus sign
- Toggles for uppercase, prefix, and digit grouping in one row
- Per-row copy buttons so you take exactly the value you want
- Runs entirely in the browser, which keeps protocol fields and internal data off the network
Use cases
Whenever the same number has to move between several bases or several bit views and one of them has to be exactly right, this tool keeps the steps short and the answer trustworthy.
-
Bitwise and mask debugging
Turn a permission value or flag into binary, eyeball which bits are on, click to flip suspect bits in place, and reconcile against the AND, OR, and XOR in your code.
-
Registers and embedded work
Expand a register manuals 0x value into binary, enable an 8, 16, or 32 bit two complement view, and read off both the per-bit meaning and the signed value.
-
Protocol fields and byte order
Take a hex field from a packet capture or log and rebuild it as binary or decimal, then verify the byte order in BE and LE against the spec.
-
Colour and styling tweaks
Move between hex RGB and decimal channel values to verify design tokens express the colour you actually expect.
-
Algorithm practice
Sanity-check hand-computed answers on base conversion, bit counting, and bitmask compression using the live bit grid, popcount, and leading-zero readouts.
-
CTF and reverse engineering
Slide bytes between binary, hex, and decimal, then re-order them under LE or BE while reading dumps, shellcode, and file headers.
-
Database and ID inspection
Crack open Snowflake IDs, UUID high bits, auto-increment counters, and bitmask columns to see the structure underneath.
-
Teaching and documentation
Use a stable, copyable, interactive panel to walk through two complement, byte order, or base conversion in a class or doc.
See also
Once the integers in an API response check out, you can keep using JSON Formatter to inspect the rest of the payload. If the value you were converting is a hex signature or file fingerprint, try recomputing it with Hash Generator for comparison. And if the hex you just decoded is actually a colour, send it through Color Converter to expand it into RGB, HSL, OKLCH, and other CSS forms.
Best practices
Base conversion is deterministic, but how you spell the result inside code, docs, register references, and protocol fields shapes how other people read it. Consistency makes those handoffs easier.
- Agree on a base-style convention per surface — for example hex for bitmasks, decimal for counts — so docs, configs, and tests do not mix without warning.
- For bitwise logic in code review, leave a binary comment next to the mask so reviewers do not need to do the math in their head.
- When debugging registers, write the per-bit meaning into a comment or doc instead of trusting memory; the next maintainer will appreciate it.
- Use BigInt or a string representation for 64-bit-plus IDs and bit fields in scripts, instead of letting them silently coerce to Number.
- Pick a single case style for hex in docs, all upper or all lower; inconsistent casing creates noise in diffs.
- When screenshotting values for collaborators, label the source and target base so 0b1010 is not mistaken for decimal 1010.
- When debugging cross-architecture data, state the byte order and width explicitly so the same hex does not parse to different values for different readers.
Limitations
The tool focuses on converting and visualising integers across bases. It does not attempt to parse richer numeric semantics or bit-level encodings.
- Integers only. Fractional binary, floating-point bit patterns, and IEEE 754 decoding are out of scope.
- Negatives default to a leading minus sign. Pick an 8, 16, 32, or 64 bit width in the Bit view tab to see the raw complement bits.
- Recognised prefixes are 0x, 0X, 0o, 0O, 0b, 0B, and #. Trailing H or h suffix hex is not auto-detected and has to be rewritten before pasting.
- Radix is limited to 2 to 36. Custom encodings like Base58, Base62, and Base64 belong in their dedicated tools, not here.
- Spaces, underscores, and grouping separators are tolerated; any other character outside the current base is treated as an error.
- The tool does not check business rules, for example whether only the low 5 bits of a register are meaningful. That validation belongs in your code.
- It will not decide which base is most appropriate for a value. You pick the source base; you pick the result you copy.
FAQ
These are the questions that show up most often when teams reach for a base converter during debugging, protocol work, embedded development, and algorithm practice.
Can both the source and target bases be anything?
Yes. Both accept any integer between 2 and 36. The source is a single radix; target bases can be many, and you can add or remove them at any time.
Which target bases are listed by default?
Binary, octal, decimal, and hex are added by default. Drop the ones you do not need; to add another radix such as 7, 12, 20, or 36, type the number into the input next to Add target base and press the plus button.
What happens when I click a bit in the grid?
The tool XORs the bit, reformats the new value in the current source base, and writes it back to the input field. All target rows, bit stats, and two complement views update together.
Why do I have to pick a width before flipping bits on negatives?
The complement bits of a negative number depend on the width: -1 looks different at 8, 16, and 64 bits. The grid only enables clicks once you have committed to a width, so the result is unambiguous.
Does it understand 0x, 0o, and 0b prefixes?
Yes — once you enable Detect 0x / 0o / 0b prefixes, a prefix overrides the radix you set manually. On the output side, you can toggle whether prefixes are added.
Can I enter negative numbers?
Yes, prefix the value with a minus sign. Each result is shown with the same leading minus; switch to the Bit view tab and pick a width to see the raw complement bits.
Will it handle integers larger than 64 bits?
Yes. All math runs through BigInt, so the 2 to the 53rd precision wall in JavaScript Number does not apply. 128-bit and 256-bit values convert cleanly.
How are bytes split for big-endian vs little-endian?
The tool takes the unsigned value at the chosen two complement width and slices it into that many bytes, then lists them with the high byte first for BE and the low byte first for LE.
What do leading and trailing zeros mean in the bit stats?
Leading zeros count contiguous zeros from the high end of the current display width; trailing zeros count contiguous zeros from the low end.
Can I group digits in binary and hex output?
Yes. Enable Group digits. Binary is grouped every 4 bits, hex every 2 characters.
Is my input sent to a server?
No. Parsing, conversion, and the bit grid all run in the browser, which keeps undisclosed protocol fields, internal register values, and debug snapshots local.
Can it convert fractional or decimal-point numbers?
Only integers are supported right now. Fractional binary, floating-point bit patterns, and IEEE 754 decoding need a dedicated float-inspection tool.
Related tools
After the conversion, you can keep working with related data, security, and design tools to handle the surrounding payload, signatures, or colour values.