Skip to main content
Developer Tools · Free

TOML to JSON Converter

Convert TOML to JSON online — paste TOML or upload a .toml file and get clean, syntax-highlighted JSON instantly. This free online TOML parser validates against TOML v1.0, maps tables and arrays of tables to JSON objects and arrays, and pinpoints syntax errors with exact line numbers. 100% client-side: your config never leaves your browser.

Waiting for input

    How to convert TOML to JSON

    1. Paste or upload. Paste TOML into the input panel, upload a .toml file (Cargo.toml, pyproject.toml, Hugo config), or load one of the built-in examples.
    2. Converted instantly. The online TOML parser validates your input and renders JSON live — [tables] become objects, [[arrays of tables]] become arrays of objects.
    3. Pick a style. Choose pretty-printed JSON (2 spaces, 4 spaces, tab), minified JSON, or sorted keys A–Z for diff-friendly output.
    4. Copy or download. Copy the JSON to your clipboard or download it as a .json file. Nothing is ever uploaded — conversion is 100% client-side.

    TOML → JSON type mapping

    Every TOML v1.0 value type maps to JSON as follows. The notes panel under the output reports exactly which conversions were applied to your document.

    TOMLBecomes JSONNotes
    [table] / dotted keysNested objectserver.limits.rate = 100 → nested objects
    [[array of tables]]Array of objectsEach [[block]] appends one element
    { inline = true }Nested objectSingle-line inline tables
    String (basic, literal, multi-line)StringEscapes processed; '''literal''' kept raw
    Integer (dec, hex, oct, bin)NumberUnsafe integers > 2⁵³−1 are flagged in notes
    FloatNumberinf / -inf / nan → null
    Booleantrue / false—
    Offset date-timeISO-8601 string (UTC)2026-10-09T20:00:00+07:00 → "2026-10-09T13:00:00.000Z"
    Local date-time / date / timeString as writtenJSON has no date type; kept verbatim
    Array (multi-line ok)ArrayTrailing commas and comments allowed
    # commentRemovedJSON has no comments

    What this TOML to JSON converter handles

    • Full TOML v1.0 parsing. Tables, sub-tables, arrays of tables, inline tables, dotted keys, and quoted keys — validated strictly, not with regex guesswork.
    • Multi-line strings. Both """basic""" (with escapes and line-ending backslash) and '''literal''' strings parse correctly.
    • Date & time aware. Offset date-times, local date-times, local dates, and local times are detected and converted to ISO-8601 JSON strings with a full count in the notes.
    • Line-number error messages. Paste any document to validate TOML syntax: the built-in TOML validator reports errors with exact line and column — duplicate keys, redefined tables, bad escapes, and more.
    • Pretty or minified JSON. Output styles: 2-space, 4-space, tab-indented, or minified, plus optional A–Z key sorting for stable diffs.
    • Syntax-highlighted output. Keys, strings, numbers, and booleans are color-coded for fast visual scanning of large configs.
    • File upload & download. Drop in a Cargo.toml or pyproject.toml — Cargo.toml to JSON and pyproject.toml to JSON work out of the box — and export the result as a .json file.
    • Private by design. Zero network requests — free TOML to JSON conversion happens 100% client-side: parse, highlight, copy, and download all run locally in your browser.

    Related developer tools

    TOML to JSON — frequently asked questions

    How do I convert TOML to JSON?

    Paste your TOML into the input box on the left, or upload a .toml file — the JSON output appears instantly on the right as you type. Choose an indent style (2 spaces, 4 spaces, tab, or minified), then copy the result or download it as a .json file. This online TOML parser converts TOML to JSON entirely in your browser.

    What happens to TOML dates and times when converting to JSON?

    JSON has no date type, so every TOML date/time becomes an ISO-8601 string. Offset date-times are normalized to UTC (for example 2026-10-09T20:00:00+07:00 becomes "2026-10-09T13:00:00.000Z"), while local dates, local times, and local date-times are kept exactly as written. The notes panel tells you how many date/time values were converted.

    Are TOML comments preserved in the JSON output?

    No. Comments, blank lines, and TOML quoting styles are stripped during parsing because JSON has no way to represent them. Only the data — tables, keys, values, and arrays — is carried over into the JSON output.

    How does the TOML validator report errors?

    The converter validates your input against the TOML v1.0 specification and reports every problem with an exact line and column number. The most common errors are duplicate keys, a table defined more than once, unterminated strings, leading zeros in numbers (such as 01), and invalid escape sequences. Fix the highlighted line and the output updates live.

    What happens to inf, -inf, and nan when converting TOML to JSON?

    JSON has no representation for infinity or not-a-number, so inf, -inf, and nan are converted to null. Each occurrence is counted in the conversion notes panel so nothing is silently lost.

    Does it support arrays of tables, inline tables, and dotted keys?

    Yes. Arrays of tables ([[products]]) become JSON arrays of objects, inline tables ({ min = 2, max = 20 }) become nested JSON objects, and dotted keys (server.limits.rate = 100) expand into nested objects. Multi-line basic and literal strings, hex/octal/binary integers, and all four TOML date/time types are supported.

    Is my TOML data uploaded to a server?

    No. Conversion runs 100% client-side in JavaScript — your TOML never leaves your browser, is never uploaded, and is never stored. It is safe to convert config files that contain secrets, API keys, or database credentials.

    Can I convert a Cargo.toml or pyproject.toml file?

    Yes. Upload any .toml file — Cargo.toml, pyproject.toml, Hugo config, or Netlify config all work. [sections] become nested JSON objects and [[arrays of tables]] become JSON arrays. Note that only generic TOML syntax is validated; format-specific required fields (such as Cargo package metadata rules) are not checked.

    Note: this tool validates generic TOML v1.0 syntax only. It does not enforce format-specific schemas (for example, required Cargo package fields). Date/time values become strings because JSON has no date type.

    Free tool by NRTechStudio