Developer Tools
printf Format Tester
Paste a C or POSIX printf format string, supply arguments, and preview the rendered output with a per-token explanation, dynamic width, and dynamic precision.
Each line is one argument. Numbers (123, -1.5), booleans (true), and null parse as their JSON values. Anything else is a string. Wrap a string in double quotes if you need escapes like \n.
Quick samples
Output
2 specs | 2 args expectedHello, Ada! You have 3 new messages.
Argument inspector
2 arguments- Arg 1string
Ada
- Arg 2number
3
How to use
- Paste your printf format string into the top field. The full %[flags][width][.precision][length]conversion grammar is supported.
- Enter one argument per line in the second field. Numbers, true, false, and null parse as JSON values. Plain text is treated as a string. Wrap a string in double quotes if you need escapes like \n.
- Read the rendered output on the left and the per-token breakdown on the right. Each conversion spec is explained with flags, width, precision, and length modifiers.
- If the expected argument count and the supplied count differ, the page surfaces a warning so you can fix the format string or add the missing argument.
- Click any Copy button to grab the full output, an individual rendered segment, or a ready-to-paste C printf call.
About this tool
printf Format Tester parses a C or POSIX printf format string, applies the arguments you provide, and shows the rendered output next to a per-token breakdown that explains what each conversion specification does. The parser walks the full %[flags][width][.precision][length]conversion grammar, recognises every flag (- + space # 0 '), accepts literal or asterisk-driven width and precision, and reads the standard length modifiers (hh, h, l, ll, j, z, t, L) without changing the rendered value for that token. It supports the conversion characters that real format strings actually use: %d and %i for signed decimals, %u for unsigned decimals, %o for octal, %x and %X for hexadecimal, %b for binary (a glibc, Python, and Go extension), %f and %F for fixed-point floats, %e and %E for scientific notation, %g and %G for the compact form, %a and %A for hex floats, %c for characters or code points, %s for strings, %p for pointer-style hex, and %% for a literal percent. Each argument line you type is parsed as a JSON literal first (numbers, true, false, null, and quoted strings work as expected) and falls back to a raw string when the line is not JSON, so most real arguments paste in without ceremony. The output panel reports the rendered text, the number of spec tokens, the expected argument count, and warnings when too few or too many arguments are supplied. The token breakdown explains every spec in plain English, surfaces the resolved width and precision, copies each rendered segment individually, and exports the whole call as a ready-to-paste C printf line so you can verify a tricky format against a real compiler in seconds. Useful for debugging logs, reproducing CSV or fixed-width report layouts, learning the printf grammar, and converting between C, Python percent formatting, and Go fmt strings without guessing. Everything runs locally in your browser, so the format string, the arguments, and the rendered output never leave your device.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
Regex Tester
Live regex testing with highlights, capture groups, and replacement preview.
Open tool
DeveloperRegex Explainer
Plain English, token-by-token breakdown of any JavaScript regular expression.
Open tool
DeveloperASCII Table
Searchable ASCII reference plus a two-way text-to-code converter.
Open tool
DeveloperHTML Entity Reference
Searchable HTML special character reference with named, decimal, and hex codes.
Open tool
DeveloperString Escape Tool
Escape or unescape a string for nineteen language string literals at once.
Open tool
ConverterNumber Base Converter
Binary, octal, decimal, hex, and custom-base conversion with two's complement.
Open tool