Skip to content
Number Buffet

Number base converter

Convert a number between any two bases from 2 to 36, with exact big-integer arithmetic and no precision loss.

3 min read

Settings

Quick presets

Spaces, underscores, commas and apostrophes are ignored, so 1010_1010 and 1,024 both work. Use a full stop for the radix point, and a leading minus for negatives.

A matching 0b, 0o or 0x prefix on the value is accepted and stripped.

How far to expand a fractional part. Many fractions never terminate in the target base — 0.1 in base 10 repeats forever in base 2 — so the expansion is cut here and flagged.

Affects the digits above 9 in bases 11 and up.

Only bases 2, 8 and 16 have a conventional prefix.

Binary in fours, hexadecimal in byte pairs, octal in threes, decimal in thousands.

Lists the same value in all 35 bases, ignoring the target base above.

Fine-tune the look

Pick a preset next to the image first — these controls adjust it.

Frame

A border drawn inside the edge of the image.

Advanced

Results

1 value

FF

255 in base 10 is FF in base 16.


Make an image

Turn on JavaScript to style and download these numbers as an image. The values themselves are listed above.

Text on the image

Drag a line straight onto the picture to place it — once placed, it stays exactly where you put it. Everything here is drawn into the download.

About number base converter

Positional notation — the idea that a digit's worth depends on where it sits — was not invented once. Sumerian and then Babylonian scribes wrote numbers in base 60 from roughly the third millennium BCE, using two cuneiform marks, a vertical wedge for one and a chevron for ten, repeated inside each sexagesimal place. For centuries there was no zero: a placeholder sign appears only in later tablets, and before that context alone told 2 from 120. Base 60 outlived the clay it was written on, in every clock face and protractor.

Mesoamerican scribes counted in twenties. Maya Long Count dates, inscribed from around the first century BCE, run 20, then 18 x 20 = 360 rather than 400 in the third place, a deliberate irregularity that brings that place near the length of a year. The Maya did write zero, as a shell glyph.

Binary's European history belongs to Gottfried Wilhelm Leibniz, who published Explication de l'Arithmétique Binaire in 1703. The popular story that the Chinese I Ching gave him the idea runs backwards: Leibniz had worked on base two for years beforehand, and when the Jesuit missionary Joachim Bouvet wrote to him about the 64 hexagrams in 1701, what the letters established was that the I Ching amounted to an independent, parallel invention of binary notation rather than Leibniz's source. Thomas Harriot had investigated binary and other positional systems earlier still, but published none of it; the work was found later among his papers.

Base twelve has had organised advocates: F. Emerson Andrews argued for it in New Numbers (1935), and the Duodecimal Society of America, founded in 1944, survives today as the Dozenal Society of America. Computing settled the argument on base 16 instead, for one reason: 16 is 2^4, so one hexadecimal digit is exactly four bits and two cover a byte. Writing the extra six digits as A through F became the de facto standard from 1966, in the wake of the Fortran IV manual for the IBM System/360.

Key properties

  • In every base b, the digit string "10" means b itself and "100" means b squared.
  • Writing n in base b takes floor(log_b n) + 1 digits, so the smaller the base, the longer the numeral.
  • Base 36 is the largest base writable with the ten digits plus the twenty-six letters of the Latin alphabet, which is where this converter stops.
  • Because 8 = 2^3 and 16 = 2^4, converting between bases 2, 8 and 16 is pure digit grouping — no arithmetic is required.
  • A number is divisible by b - 1 exactly when the sum of its base-b digits is; casting out nines is this rule for b = 10.
  • 1/d in lowest terms terminates in base b only when every prime factor of d divides b, which is why 0.1 cannot be written exactly in binary.
  • Base 1 is not positional at all: with a single digit there is no place value, so unary can only repeat a mark.
  • This page converts with arbitrary-precision integers, so values far past 2^53 - 1 — the largest integer a JavaScript number holds exactly — still convert digit for digit.

Where they turn up

  • Minutes, seconds and the 360 degrees of a circle are inherited directly from Babylonian base 60.
  • The Maya Long Count is base 20 with one deliberate irregularity: its third place counts 18 twenties, giving 360 days rather than 400.
  • URL shorteners and short-ID schemes encode database row numbers in base 36 or base 62 to keep links brief — a convention, not a standard.
  • Punycode, which carries internationalised domain names through ASCII-only systems, uses a 36-symbol digit alphabet (a-z for 0-25, then 0-9 for 26-35); it is widely described as base 36, but its generalised variable-length integers are not a plain positional base.
  • French quatre-vingts for 80 and the Danish counting words are often cited as traces of older base-20 systems; the Celtic-substrate explanation for the French forms is disputed among linguists.

How to use this generator

The generated values appear at the top, with a copy button beside them. To turn them into an image, pick a look from the style presets under Make an image, choose an export size, and download as PNG, JPEG or WebP. Everything is rendered in your browser, so nothing you generate is sent to a server.

The address bar updates as you work, so the link always reproduces exactly what you see — handy for sharing a specific sequence or saving a configuration for later. Use Copy to take the values as plain text, or Export data for CSV, JSON, NDJSON, SQL or XML.

Sources

Historical summaries on this page draw on the openly licensed references listed above. Spotted an error? Tell us and we will fix it.