Back to the blog

Developer

Roman numerals, in their usual form.

Turn numbers from 1 to 3,999 into Roman numerals, or numerals back into numbers, in your browser, in their usual form only. Nothing is uploaded.

By 3 min read

A developer toolkit reading encoded text in two steps, URL decode then Base64 decode, to give Hello, world!

Seven letters write every number from 1 to 3,999. The Roman numeral converter writes them in the form most books, films and buildings use, and reads them back.

Seven letters, added and taken away.

I is 1, V 5, X 10, L 50, C 100, D 500 and M 1,000. They are written from largest to smallest and added up: 2026 is MMXXVI, 1,000 + 1,000 + 10 + 10 + 5 + 1.

Six pairs take the smaller from the larger: IV is 4, IX 9, XL 40, XC 90, CD 400 and CM 900. So 1994 is MCMXCIV: M, CM, XC and IV.

Only the usual form.

Many clock faces write IIII for 4, and some people write IC for 99. The converter reads a numeral only when writing its value again gives exactly what was typed, so IIII and IC are named in a note and left as they are.

Numbers below 1 or above 3,999 stay as they are, with a note: the usual form has no zero, and past 3,999 it needs a bar over the letters, which plain text cannot carry well.

Many at once.

Every whole number in what you type is turned, so a list of years or chapter numbers can be pasted together. Going the other way, every word made only of I, V, X, L, C, D and M is read.

That means an ordinary word made of those letters, such as mix, is read as a numeral too (1,009), so paste numerals rather than sentences.

Nothing leaves your browser.

Everything is worked out on your device: what you type or paste is never sent anywhere, and nothing is kept when you leave.

Roman numerals are one step of the Developer toolkit, beside binary, Morse code and Unix time.

Further reading

Topics: roman numeral converter · roman numerals · numbers to roman numerals · roman numerals to numbers · roman numeral chart · year in roman numerals

A little less theory. A little more doing.

Try it on your own terms, with a free browser tool.

Try the tool