Guides
Number base conversion for debugging

Debugging often means the same quantity written three ways. A log shows 0xFF, a comment says 255, and a bitmask diagram wants eight bits. Number base conversion turns those views into each other so you stop guessing. Toolsy’s number base converter parses binary, octal, decimal, or hex (including common 0b / 0x / 0o prefixes) with BigInt, then shows all four outputs. Use it for flags, Unix-style permissions, hex dumps, and class drills. It is an integer tool, not a float or IEEE-754 inspector.
Why bases collide in real bugs
Humans default to decimal. Systems talk in hex for bytes and binary for flags. Two correct values look like a mismatch until you convert.
Permission masks and feature flags pack many booleans into one integer. In decimal the number looks arbitrary. In binary the set bits become obvious.
Hex dumps compress bytes. You copy a two-digit hex pair, paste it into a calculator that assumed decimal, and chase a phantom bug for an hour.
What you can try yourself first
Write both forms in the bug note: flags=13 (0b1101) or len=0x400 (1024). Reviewers follow faster when both bases sit next to each other.
For flags, convert to binary and mark bit positions from the right starting at zero. Match that grid to the enum or datasheet.
For file modes, remember octal habits (0755) still appear in docs. Convert to decimal or binary when your language prints another base.
When hex is the right view
Hex maps cleanly to bytes: two digits per byte. Memory addresses, color channels adjacent to design work, and hash prefixes scan faster in hex than in long binary strings.
Use hex when the artifact is already a dump or a color token. Convert to decimal when an API response or metric dashboard refuses hex.
When binary is the right view
Binary is for bit identity. You care which flag is on, not how compact the writing is. Convert the suspect integer to binary, then AND with the mask on paper or in a REPL.
Octal sits between them for legacy Unix modes. Reach for it when the doc already uses octal; otherwise prefer binary for bit talk and hex for bytes.
How to prepare the value you will paste
Strip spaces and separators. Paste 0x1a2b or 1a2b with hex selected. For binary, paste bits or 0b….
Confirm the input base in the UI before you type. A decimal 10 and a binary 10 are different quantities. Wrong base is the most common self-inflicted error.
Drop fractional parts. This converter is for integers. Float bit patterns need a different workflow.
Walkthrough in the number base tool
- Open Number base.
- Select the input base: Binary, Octal, Decimal, or Hex.
- Paste or type the value. Prefixes like
0x,0b, and0oare accepted for the matching bases. - Read binary, octal, decimal, and hex outputs together.
- Copy the base you need into the ticket, test, or comment.
BigInt backing means large integers work for homework and many debug values. Leading zeros in binary input are not kept as significant formatting in the output string; the numeric value is what matters.
Prefixes and paste hygiene
Keep the prefix when you copy from logs. It documents intent. If the paste fails to parse, remove spaces and confirm you selected the matching base.
Hex letters are case-insensitive on the way in. Output hex is lowercase digits from the converter; add 0x in your note if your style guide wants it.
Bitmask check pattern
Paste the combined flags as decimal or hex. Read the binary output. Compare each 1 to the flag table. If a bit you expected is 0, the runtime never set that flag; stop blaming the formatter.
How to check the result and catch mistakes
Convert back the other direction. Decimal → hex → decimal should round-trip for the same integer.
Compare width assumptions. An 8-bit unsigned 255 is not the same story as a signed interpretation in a narrow type. The tool shows the mathematical integer; signedness is still your job in the language.
Cross-check with a known value: 255 ↔ ff ↔ 11111111. If that fails, the input base is wrong.
Related jobs while you debug encodings
Timestamps that look like huge integers often need Unix timestamp conversion, not radix math. See Unix timestamp conversion pitfalls.
Payload blobs and data URLs sit next to base tools in day-to-day debugging. Use Base64 encode when the problem is encoding, not radix; the guide Base64 encode for email HTML and data URLs covers that path.
Brand or CSS hex colors belong in Color converter when you need RGB channels, not a general integer dump.
Limits, privacy, and when not to use this
Conversion stays in the browser. Nothing is uploaded. Prefer local tools for production secrets anyway.
This page does not verify two’s-complement display widths, floats, or endianness of multi-byte dumps. It converts integer text forms.
Do not paste live production tokens that happen to look numeric into shared screens. The tool is private to the page; the meeting screen share is not.
Frequently asked questions
How does binary to decimal conversion work here?
Select Binary as the input base, paste the bits (optional 0b prefix), and read the Decimal row. Octal and hex update at the same time. Use that path for homework checks and quick flag totals.
Can I go from decimal to binary as well as binary to decimal?
Yes. Set the input base to Decimal, type the number, and copy the Binary output. The same page covers octal and hex so you do not bounce between single-purpose sites.
How large can a binary to decimal number be?
The converter uses JavaScript BigInt, so very large integers parse when the text is valid. Extremely long pastes may be awkward to read in a ticket. Keep flags and dump slices to the width you actually debug so reviewers can scan the bits.
Does binary to decimal accept 0b or 0x prefixes?
Yes for common prefixes. Hex accepts 0x, binary 0b, and octal 0o when you paste that style. Set the matching input base so the parser knows which digits are legal.
Is this binary to hex converter free?
Yes. No account and no daily limit on the page. All four bases update locally as you type. Favorites and paid plans are unrelated to this converter.
Why do my flags look wrong in decimal?
Decimal hides bit identity. Convert to binary and compare positions to the enum. A “random” decimal often becomes an obvious missing bit once you see the pattern.
Can I convert Unix file permissions from octal?
Yes. Choose Octal, paste a mode like 755 or 0o755, and read decimal or binary if your code uses those forms. Confirm whether a leading zero in a language literal meant octal; that confusion is classic.
Does the tool handle floating point?
No. Paste integers only. IEEE-754 bit inspection needs a float-specific viewer. Mixing float text into an integer converter produces confusion, not insight.
Will leading zeros in binary be preserved?
The numeric value is preserved. Formatted leading zeros are not treated as significant digits in the output string. Pad manually in notes when a fixed width matters for a register diagram.
Does number base upload my values?
No. Parsing runs in your browser. Still avoid projecting sensitive production constants on shared screens. For encoding of blobs instead of radices, switch to Base64 workflows.
For time values that look like large integers, continue with Unix timestamp conversion pitfalls. For color hex channels in CSS, use the color converter.
Convert number bases
Switch binary, octal, decimal, and hex with BigInt support. Paste 0b or 0x prefixes. Runs in your browser.


