Number base converter
Convert integers of any size between bases 2 and 36, one per line, with optional two’s complement for signed 8 to 128-bit values.
Process locally
Files stay in this browser session. Closing or clearing releases them.
Add text
Type or paste the text to process
Adjust settings
Optional: From base, To base, Signed numbers and more
Run
Processes in this browser; cancel at any time
About this tool
Convert whole numbers between any bases from 2 to 36, such as decimal to binary or hex for programming homework, a memory address or a set of bit flags. Put one number per line to convert a whole list in one run.
Integers of any size are supported. Negative values either keep their minus sign or become two’s complement patterns at 8, 16, 32, 64 or 128 bits, and the output can use uppercase letters and a 0x, 0b or 0o prefix. Fractions are not supported. The conversion runs in your browser.
How to use it
- Under “Add text”, type or paste one whole number per line, or select “Use example”.
- Under “Adjust settings”, set “From base” and “To base”, each from 2 to 36. The default converts base 10 to base 16.
- For negative numbers, choose “Plain values (minus sign kept)” or “Two’s complement at the bit width” under “Signed numbers”, and pick a “Bit width”.
- “Uppercase letters” is on by default; tick “Add 0x, 0b or 0o prefix” if you want one. Then select “Run”.
- Check the results line by line under “Preview and download”, then download them as a text file.
Formats and limits
- Input
- Text
- Output
- Plain text
- Size limit
- 1 MB
- Settings
- From base; To base; Signed numbers (Plain values, Two’s complement at the bit width); Bit width (8-bit, 16-bit, 32-bit, 64-bit, 128-bit); Uppercase letters; Add 0x, 0b or 0o prefix
- Privacy
- Files stay in the current browser session. No file bytes are uploaded.
- Price
- Free, no sign-up
Common questions
How are negative numbers converted?
With “Plain values (minus sign kept)”, the sign stays as it is, so -10 becomes -A in base 16. With “Two’s complement at the bit width”, a negative decimal becomes its bit pattern, for example -1 is FF at 8 bits, and binary or hex results are padded to the full width. A number outside the range of the chosen width stops the run with an error.
How is a hex or binary pattern read back as a signed number?
Choose “Two’s complement at the bit width” and convert to base 10. Input in another base without a sign is read as a bit pattern, so at 8 bits FF becomes -1, 80 becomes -128 and 7F stays 127.
Can it convert fractions or decimals like 3.14?
No, only integers. A line with a decimal point stops the run, and the error names the value that could not be read.
How large can the numbers be?
In plain mode there is no fixed number of digits, so values far beyond 64 bits convert exactly. The input text can be up to 1 MB, and two’s complement works up to 128 bits.
Can the input include a 0x prefix or separators?
Yes. When “From base” is 2, 8 or 16, a matching 0b, 0o or 0x prefix is accepted. Spaces and underscores inside a number are ignored, as in 1_000, and letters can be upper or lower case.
Related tools
IEEE 754 float converter
Show the single or double-precision bits of decimal numbers, or read hex and binary bit patterns back as numbers, one per line.
Sign-magnitude, ones’ and two’s complement
Sign-magnitude, ones’ complement and two’s complement of decimal integers, one per line, at 8, 16, 32 or 64 bits.
Byte radix and endianness converter
Convert bytes between hex, binary, octal, unsigned or signed decimal, Base64 and UTF-8 text, and swap byte order between big and little endian in 2, 4 or 8-byte words.
Character set encoding and mojibake repair
Show the bytes of text in UTF-8, GBK, GB18030, Big5, Shift_JIS and more as hex, turn hex back into text, or repair mojibake from text read in the wrong character set.
File to hex
Show any file as hex: a hexdump with offsets and an ASCII preview, plain hex, or a C byte array.
Encode and decode text
Encode or decode Base64, Base64URL, URL, hexadecimal or HTML entities. Encoding is not encryption.