About
About numlit
A free, open tool for one easily-missed question: what does each language’s compiler think your literal is?
Every language has its own lexer rules for numeric literals — prefixes, leading zeros, separators, suffixes — and they
disagree. 017 is octal in C but decimal in Rust and an error in Python; 1_000 works almost everywhere
except C (apostrophe); 100L is a long in Java but a syntax error in Go.
numlit covers C (C23), Rust, Go, Java, Python 3 and JavaScript and the common literal forms, computing integer values exactly with BigInt and flagging overflow, precision loss and leading-zero traps. It is deliberately not a base converter, and it runs entirely in your browser. Rules follow each language’s spec; confirm exotic edge cases against the official reference.