Home › Developer Tools › JSON to TOML Converter

JSON to TOML Converter

Paste JSON and get idiomatic TOML for Cargo.toml, pyproject.toml, Hugo or any config file. Choose [table] sections or inline tables, keep 64-bit integers exact and see the precise line of any JSON error.

Last updated:

Strict JSON validation and a TOML v1.0 writer run in this tab; nothing is uploaded. Going the other way? Use TOML to JSON. Tip: Ctrl + Enter converts.

Advertisement
Advertisement

How to use the JSON to TOML Converter

  1. Paste your JSON into the left box, drop a .json file on it or press Open .json. A sample config is loaded to start.
  2. Pick the layout: [table] sections or inline tables for nested objects, and [[array of tables]] or inline arrays for lists of objects.
  3. Set the details: date handling, multi-line strings, null values, sorting and indentation.
  4. Fix any JSON error shown under the editors; press Show in input to jump to the exact spot.
  5. Copy or download the TOML file.

Example: JSON and the equivalent TOML

JSONTOML
{
  "name": "demo",
  "server": {
    "host": "localhost",
    "ports": [8080, 8081]
  },
  "users": [
    { "name": "Ada" },
    { "name": "Alan", "admin": true }
  ]
}
name = "demo"

[server]
host = "localhost"
ports = [8080, 8081]

[[users]]
name = "Ada"

[[users]]
name = "Alan"
admin = true

JSON types and their TOML equivalents

JSONTOML outputNotes
string"text", 'C:\path', """…"""Literal strings when the text has backslashes; triple quotes for multi-line text
integer808064-bit signed range
decimal number0.75, 1.0, 6.02e23Copied exactly as written
true / falsetrue / falseSame keywords
ISO date string2026-03-14T09:30:00ZUnquoted TOML date-time (optional)
object[table] or { k = v }Your choice of layout
array of objects[[table]]Or an inline array of inline tables
null(none)Left out, "" or commented

Tips for clean TOML

  • Keys: letters, digits, _ and - stay bare; any other key, such as one with a dot or space, is quoted so it is not read as a nested key.
  • Cargo and pyproject: tools expect sections like [dependencies] or [tool.poetry], so keep the default [table] layout for those files.
  • Round trip: paste the output into the TOML to JSON converter to confirm it reads back to the same data.

Frequently asked questions

How is JSON converted to TOML?

The top-level JSON object becomes the root table. Plain values (strings, numbers, booleans, arrays of values) are written first as key = value lines, then nested objects become [table] sections and arrays of objects become [[array of tables]] sections. This order matters in TOML because every key after a header belongs to that table.

What is the difference between [table] sections and inline tables?

Both describe the same data. A section like [server] followed by host = "localhost" is easier to read for larger objects, while an inline table server = { host = "localhost", port = 8080 } keeps small objects on one line. TOML 1.0 inline tables must stay on a single line, so long objects are best as sections. Inline when short picks per object.

Why are null values missing?

TOML has no null type. By default keys with null are left out and the message says how many. You can instead write them as empty strings or keep them as comments so you can see where they were.

Can the top level be an array?

A TOML document is always a table. If you paste a JSON array, it is placed under the key "items", which becomes [[items]] sections for an array of objects. A bare string or number cannot be converted.

How are dates handled?

With ISO strings as TOML dates on, strings such as 2026-03-14, 2026-03-14T09:30:00Z or 07:32:00 that are valid dates or times are written without quotes, so TOML reads them as date-time values. Turn it off to keep them as quoted strings.

Are large numbers kept exactly?

Yes. Numbers are copied from your JSON text rather than through floating point, so 9007199254740993 and 1.0 keep every digit. TOML integers are 64-bit, so an integer beyond ±9,223,372,036,854,775,807 is written as a string with a warning.

Is my JSON uploaded?

No. Parsing and conversion run in JavaScript inside this page, so config files containing secrets never leave your device.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

TOML to JSON ConverterConvert TOML to JSON and JSON to TOML with a full v1.0 parser and clear error lines.JSON to YAML ConverterConvert JSON to clean YAML as you type, with indent, quoting and sort options.JSON ValidatorCheck JSON with the exact line and column of each error, fix tips and one-click auto-fix.JSON FormatterBeautify, minify and validate JSON, with a collapsible tree view.JSON to Excel ConverterTurn JSON into a styled .xlsx spreadsheet; nested arrays become their own linked sheets.JSON to CSVConvert JSON data to CSV for spreadsheets.CSV to JSONConvert CSV data to JSON with live preview.Excel to CSVConvert XLSX spreadsheets to CSV.CSV ViewerOpen a CSV or TSV file as a sortable, filterable table.Excel Viewer (XLSX / XLS)Open XLSX, XLS and ODS spreadsheets in your browser without Excel.Line Ending ConverterConvert text and files between CRLF, LF and CR line endings.Markdown to HTMLConvert Markdown to clean HTML with a live editor.XML to JSONConvert XML to JSON with validation.Text Encoding ConverterDetect and convert text file encodings like UTF-8, UTF-16 and Latin-1.JSON ViewerExplore JSON as a collapsible tree, search keys and values and copy any node's path.TTF to WOFF2 ConverterConvert TTF and OTF fonts to WOFF2 or WOFF and get a ready @font-face CSS snippet.Chmod CalculatorConvert Linux file permissions between checkboxes, octal (755) and symbolic (rwxr-xr-x) notation.JSON to TypeScriptGenerate TypeScript interfaces or types from JSON, with nested types and optional fields.Morse Code TranslatorTranslate text to Morse code and back, then play it as sound or a blinking light, or save a WAV.HTML Table GeneratorBuild HTML tables in an editable grid with styles, header rows, CSV import and live preview.Hex to Text ConverterConvert hex to text and text to hex with UTF-8 support and space, 0x, \x or comma formats.JSON to XML ConverterConvert JSON to well-formed XML with attributes, arrays and pretty print.YAML to JSON ConverterConvert YAML to pretty or minified JSON, with errors pinned to the exact line.HTML to Markdown ConverterTurn HTML or pasted rich text into clean Markdown with tables and live preview.Markdown Table GeneratorBuild Markdown tables in a grid or paste from Excel/CSV, with alignment and preview.Image to Base64Convert images to Base64 data URIs, CSS backgrounds and HTML img tags in your browser.Base64 to ImagePaste a Base64 string or data URI to preview, identify and download the image.JSON CompareCompare two JSON documents and see every added, removed and changed path.Hex to DecimalConvert hex to decimal instantly with steps and signed mode.Decimal to HexConvert decimal to hex instantly with steps and signed mode.Binary to DecimalConvert binary to decimal instantly with steps and signed mode.Decimal to BinaryConvert decimal to binary instantly with steps and signed mode.Two's Complement CalculatorDecimal to two's complement binary and back for 4-64 bits, with invert-and-add-1 steps.XML to CSV ConverterConvert XML to CSV: detects repeating records, flattens nested data, pick your columns.CSV to XML ConverterConvert CSV to well-formed XML with custom root and row names, escaping and pretty print.JSON to Go StructTurn JSON into Go structs with inferred types, nested structs and json tags.JSON to Python ClassGenerate Python dataclasses, Pydantic models or TypedDicts with type hints from JSON.JSON to C# ClassConvert JSON to C# classes or records with System.Text.Json or Newtonsoft attributes.CSV to SQL ConverterConvert CSV to SQL CREATE TABLE and INSERT statements for MySQL, PostgreSQL, SQLite or SQL Server.IPv4 to IPv6 ConverterConvert IPv4 to IPv4-mapped, 6to4 and NAT64 IPv6, extract IPv4 from IPv6, and get int/hex/binary.cURL to Code ConverterConvert curl commands to JavaScript fetch, Axios, Python requests, Node.js, PHP and Go code.Code to ImageTurn code into a beautiful syntax-highlighted PNG with themes, window frame and background.Excel to JSON ConverterConvert Excel sheets (XLSX, XLS, ODS) to JSON with header row, type and shape options.CSV to Excel ConverterConvert CSV files to a real .xlsx workbook with typed numbers and dates, one sheet per file.CSV SplitterSplit a large CSV into smaller files by row count, file count or column value, header kept.CSV MergerCombine many CSV files into one, matching columns by name, with dedupe and a source column.VCF to CSV ConverterConvert vCard (.vcf) contacts to CSV for Google or Outlook, or turn a CSV back into a VCF.Calendar Event (.ics) GeneratorCreate an .ics calendar invite with time zone, reminders and repeats + Google/Outlook links.CSV Column ExtractorPick, reorder and rename CSV columns, filter rows by value, and export a new CSV or JSON.CSV Diff CheckerCompare two CSV files by key column and see added, removed and changed rows cell by cell.CSV Duplicate Row RemoverRemove duplicate rows from a CSV by all or selected columns and download the cleaned file.CSV to HTML TableTurn CSV into clean HTML table code with a live preview, styling options and one-click copy.CSV to Markdown TableConvert CSV to a neatly aligned GitHub Markdown table with column alignment and live preview.CSV TransposeSwap rows and columns of CSV, TSV or pasted spreadsheet data, with delimiter auto-detect.Date Format ConverterConvert any date to ISO 8601, RFC 2822, Unix time and custom strftime, moment or Java patterns.ENV to JSON ConverterConvert .env files to JSON or YAML and JSON back to .env, with quotes and multiline values.File to Base64Convert any file to a Base64 string or data URI with MIME detection, line wrap and download.HTML Table to CSVExtract any table from HTML or page source to CSV, TSV or JSON, with colspan and rowspan handled.IEEE 754 Floating Point ConverterConvert decimals to 32/64-bit IEEE 754 floats: toggle bits, see hex, exact value and rounding error.INI to JSON ConverterConvert INI and CFG files to JSON and JSON back to INI, with sections, arrays and types.IP Address ConverterConvert IPv4 to decimal, hex, binary, octal and back, with class and private/public check.ISBN Converter & ValidatorConvert ISBN-10 to ISBN-13 and back, validate check digits and hyphenate, one or in bulk.JSON Flatten / UnflattenFlatten nested JSON to dot or bracket path keys, or unflatten flat keys back to nested JSON.JSON to Dart ClassTurn JSON into Dart model classes with fromJson, toJson, null safety and nested classes.JSON to Java ClassTurn JSON into Java POJOs or records with Lombok, getters/setters and Jackson or Gson annotations.JSON to Kotlin Data ClassTurn JSON into Kotlin data classes for kotlinx.serialization, Gson, Moshi or Jackson.JSON to Markdown TableTurn a JSON array of objects into a GitHub Markdown table with column picker and alignment.JSON to PHP ArrayConvert JSON to PHP array code (short [] or array()) and PHP arrays back to JSON.
See all 129 Data & File Format Converters →