Number system converter — binary, octal, decimal, and hexadecimal integers

Use this free radix converter online to translate the same whole number across base 2 (binary), base 8 (octal), base 10 (decimal), and base 16 (hexadecimal). Parsing uses JavaScript BigInt, so large bit masks and pointer-sized values stay exact—unlike floating-point shortcuts that round past Number.MAX_SAFE_INTEGER. Accepts familiar C-style prefixes (0b, 0o, 0x), strips underscores and spaces inside digit runs, and formats outputs you can copy with one click. Optional binary nibble grouping aligns long strings with hex nybbles for dump-style reading. Everything runs in your browser. Pair it with the Base64 encoder and decoder when you need byte encoding rather than a numeric radix change, and the Unix timestamp converter when logs mix decimal epochs with hex file offsets.

Integers only, parsed with BigInt for exact large values. Binary grouping affects spaces only. Hex prefix 0x applies after the sign, e.g. -0xff for negative values.

Why binary, octal, decimal, and hex still matter in 2026

Binary representation is how hardware exposes registers and buses. Octal lingers in Unix file permission triples (chmod 755). Decimal is the human default for business logic and APIs. Hexadecimal compresses bits 4:1—ideal for memory addresses, CSS colors, UUID fragments, and crypto fingerprints. A single number base converter short-circuits mental arithmetic when you jump between a serial console, a web palette, and a REST JSON body.

Searchers often look for binary to decimal calculator, hex to binary translator, or octal to decimal online—this page covers all of those flows from one input field by fixing the source radix first, then exposing every target radix at once.

How to use this number system converter (step by step)

  1. Choose input base: Use the dropdown for binary, octal, decimal, or hex. The parser then knows whether letters a–f are valid and which digit range applies.
  2. Type or paste: Include optional prefixes when they help—0xff, 0b1010, 0o12. Underscores and interior spaces are removed so copied literals from Rust, Verilog, or markdown tables still parse.
  3. Tune display: Enable nibble grouping when you want spaced binary that lines up with hex columns. Toggle uppercase hex or 0x labels when your style guide or compiler expects them.
  4. Copy: Use the clipboard icon beside each output. For bulk values stored in a repo, Load from file reads a local text file into the input without uploading it.

BigInt accuracy vs double-precision shortcuts

Many “online calculator” widgets coerce inputs through IEEE-754 doubles. That breaks past 2^53 - 1, which is painful when you work with 64-bit flags, large counters, or synthesized addresses. This tool keeps the mathematical value in BigInt end-to-end so binary ↔ hex ↔ decimal round trips stay bit-exact for integers. It does not attempt fractions—if you need floating radix conversion, rely on your language’s numeric tower or a scientific calculator with explicit precision controls.

Radix conversion in real workflows

Front-end developers jump between decimal RGB components and #RRGGBB hex. Firmware engineers correlate register maps given in hex with oscilloscope traces labeled in binary. Security reviewers compare decimal CVE scores with hex offsets in disassemblers. When a log line prints both decimal milliseconds and hex object ids, the Unix timestamp converter complements this page for the time half of the puzzle.

Prefixes, literals, and language quirks

JavaScript uses 0x for hex and 0b for binary literals; Python 3 accepts 0o for octal. C and C++ lean on 0-leading octal in older code but prefer explicit prefixes in modern style. This converter normalizes those markers after you select the correct base so you can paste snippets from Stack Overflow answers without manual scrubbing—then validate surrounding syntax with the JSON formatter & validator when the value sits inside API traffic.

When Base64 is the right tool instead

Base64 encodes arbitrary bytes into a text alphabet; it is not another integer radix. If you need to ship binary blobs through JSON or email, switch to the Base64 encoder and decoder. If you need digests of strings, use the hash generator. If you are parsing structured tokens, the JWT decoder inspects Base64URL segments without verifying signatures.

Testing digit patterns and parsers

When you build lexers or CLI flags that accept multiple bases, golden tests often need both valid and invalid strings. After you sketch a regex, exercise it in the regex tester & debugger with samples copied from this converter so expected conversions and error cases stay synchronized.

Privacy and classroom use

Because conversion happens locally, students can work through CS101 radix homework on a locked-down lab machine without creating accounts. Interview candidates can sanity-check hand-derived values before whiteboarding. Nothing leaves the tab unless you copy it yourself—handy when practicing with proprietary register values.

Related developer tools

Explore the full code and developer tools catalog. Highlights:

  • JSON Formatter & ValidatorFormat, validate, minify, and explore JSON in a collapsible tree—fix payloads before they hit production.
  • JSON to CSV ConverterTurn JSON arrays into downloadable CSV with automatic column detection for spreadsheets and BI tools.
  • JSON to YAML ConverterConvert JSON to readable YAML for configs and Kubernetes—copy or download the result.
  • CSV to JSON ConverterPaste or upload CSV and get structured JSON with header-aware typing for APIs and apps.
  • YAML to JSON ConverterParse YAML to valid JSON with clear errors—ideal for CI configs and cloud templates.
  • XML Formatter & ValidatorBeautify and validate XML with structure insight and actionable parse errors.
  • Regex Tester & DebuggerTest patterns live with highlights, capture groups, and flags—debug regex without leaving the browser.
  • SQL FormatterPretty-print SQL with indentation and keyword casing for readable queries and code review.
  • HTML Formatter & MinifierBeautify or minify HTML and compare raw markup with a quick rendered preview.
  • CSS Formatter & MinifierFormat messy stylesheets or minify CSS for faster loads—keep design tokens consistent.
  • JavaScript Formatter & MinifierPretty-print or minify JavaScript for debugging locally and shipping smaller bundles.
  • HTML to Markdown ConverterConvert HTML snippets to Markdown for docs, CMS migrations, and README cleanup.
  • Markdown to HTML ConverterTurn Markdown into HTML with a live preview—handy for emails, blogs, and static pages.
  • Code Diff CheckerCompare two code blocks side by side with clear add/remove highlighting for reviews.

Frequently asked questions

What is a number system converter and who uses binary, octal, decimal, and hex?
A number system converter translates the same integer value between radices—most often base 2 (binary), base 8 (octal), base 10 (decimal), and base 16 (hexadecimal). Firmware engineers, OS students, reverse engineers, web developers (colors and pointers), and anyone reading datasheets or memory dumps use these bases daily. This page focuses on whole integers using JavaScript BigInt so large bit patterns stay exact.
Are my numbers sent to your servers?
No. Parsing and formatting run entirely in your browser. Pasting values, loading a local text file, and copying outputs never upload content to our backend unless you use another tool on the site that explicitly calls an API.
Can I paste C-style prefixes like 0x for hex, 0b for binary, or 0o for octal?
Yes. After you pick the input base, you can include optional prefixes (0x/0X, 0b/0B, 0o/0O). Underscores and spaces in the middle of the digit string are stripped for readability. Leading zeros are allowed.
Does this tool support fractions or floating-point values?
No. It converts integers only (including negative integers). For fractional bases you would need fixed-point or floating-point rules that vary by language; use your compiler or language-specific docs for those cases.
Why does very large binary take a long line in the output?
Binary expands quickly: each decimal digit needs about log2(10) ≈ 3.32 bits on average. Enable “Group binary by 4 bits” to insert spaces between nibbles for easier reading next to hex dumps. Copy still uses the grouped text when that option is on.
How is this different from a Base64 encoder?
Base64 encodes raw bytes as text using a 64-character alphabet; it is not a change of radix for a single integer. Use our Base64 tool when you need MIME-style encoding of strings or files; use this converter when you need binary, octal, decimal, or hex representations of numeric values.
Which related tools pair with a radix converter?
Use the hash generator for digests of byte strings, the Unix timestamp converter when epoch values cross decimal and hex in logs, the JWT decoder when segments look like Base64URL, and the regex tester when you validate digit patterns in parsers.