Number Base Converter
Convert numbers between Binary, Octal, Decimal, and Hexadecimal formats instantly
Examples
Convert decimal 255
Decimal: 255Hexadecimal: FF
Octal: 377
Binary: 11111111255 is one less than 256, so its binary form is eight 1 bits and its hexadecimal form is FF.
Convert decimal 42
Decimal: 42Hexadecimal: 2A
Octal: 52
Binary: 101010The same integer is represented with different digit sets and place values in each radix.
Convert decimal 1024
Decimal: 1024Hexadecimal: 400
Octal: 2000
Binary: 100000000001024 is 2^10, so its binary representation is a 1 followed by ten zeros.
About this tool
The Number Base Converter keeps four integer representations synchronized: binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Enter a value in any field and the tool parses it in that field's radix, then immediately fills the other three representations. Hexadecimal output uses uppercase A–F.
Common 0b, 0o, and 0x prefixes are stripped before parsing, and the hexadecimal field displays its own 0x prefix separately. The converter is intended for whole-number notation; it does not model a fixed bit width, fractional values, signed encodings, or two's-complement interpretation.
Each populated representation has its own copy action, and the copy shortcut collects all four labeled values. Quick presets cover common decimal values from 0 through 65535, while the reference table shows binary, octal, decimal, and hexadecimal forms for frequently used boundaries.
How to use
Choose the source base
Click the binary, octal, decimal, or hexadecimal field that matches the notation you already have.
Enter a valid integer
Use only digits legal in that base: 0–1 for binary, 0–7 for octal, 0–9 for decimal, and 0–9 plus A–F for hexadecimal. Common base prefixes are accepted and removed before parsing.
Read the synchronized values
As you type, the other three fields update with equivalent integer representations. You can also load one of the decimal quick values.
Copy or clear
Copy an individual field, use the copy shortcut to collect all four labeled forms, or click Clear All to reset every field.
Use cases
Reading bit masks and register values
Translate a hexadecimal register value into binary to inspect individual bits, then view the same quantity in decimal for logs or documentation.
Working with file modes
Convert octal values used for Unix permissions into binary groups or decimal values when comparing representations.
Debugging protocol and color constants
Move between decimal API values and hexadecimal constants commonly shown in packet formats, memory dumps, and packed color channels.
Learning positional notation
Use synchronized fields and presets to see how powers of 2, 8, 10, and 16 represent the same integer.
Common mistakes
Mistake:Assuming a leading zero makes a value octal everywhere in JavaScript.
Fix:Legacy leading-zero behavior is context-dependent and confusing. Select the Octal field or use an explicit 0o prefix in code; do not rely on a bare value such as `010` to communicate its base.
Mistake:Reading a negative binary or hexadecimal value as two's complement without specifying a width.
Fix:Two's complement requires a fixed width such as 8, 16, or 32 bits. This converter shows signed integer notation, not a padded machine representation, so decide the width before interpreting a high bit as a sign bit.
Mistake:Treating a hexadecimal value containing A–F as decimal input.
Fix:Enter it in the Hexadecimal field. Decimal accepts only 0–9, while hexadecimal assigns A–F the values 10–15.
Mistake:Using a digit that is outside the selected base.
Fix:Binary permits only 0 and 1, and octal only 0 through 7. Validate the entire input before relying on a conversion because integer parsers can stop at the first invalid digit rather than diagnose the whole string.
Frequently asked questions
Related guides
How Text Becomes Bytes: Binary, Hex, and UTF-8 Explained
What happens when you save a text file, how UTF-8 encodes characters, and why the same string can be different lengths in binary.
Thinking in Bits: Hex, Binary, Two's Complement and IEEE 754
A working programmer's guide to number bases, bitwise masks, two's-complement negatives and why 0.1 isn't really 0.1.
References & standards
Related tools
Base64 Toolbox
Professional Base64 workspace for text, files and images with Base64URL, MIME, Data URI, strict validation, image preview and ready-to-use snippets.
C# to VB.NET Converter
Convert a subset of C# — classes, methods, variables, loops — into VB.NET
CSV to Chart
Paste or upload CSV data and generate bar, line, pie, or doughnut charts. Export as PNG.
CSV to JSON Converter
Paste CSV data and convert it to pretty-printed JSON instantly — supports custom delimiters, header row toggling, and value trimming.
CSV to Markdown Converter
Convert CSV to a Markdown table and Markdown tables back to CSV
CSV to SQL Converter
Generate SQL INSERT statements from CSV data