Simplify Your Workflow: Search MiniWebtool.
Add Extension
Home Page > Text Tools > Other Text Tools > TOML to JSON Converter

TOML to JSON Converter

Convert TOML configuration to JSON instantly with this free online tool. Supports nested tables, arrays of tables, inline tables, multi-line strings, and offers pretty/compact/sorted output styles, structure visualization, line-aware error messages, and one-click samples.

TOML to JSON Converter
Quick Samples (one click to load)
Your TOML 0 chars · 0 lines · 0 non-empty
Output style

Embed TOML to JSON Converter Widget

About TOML to JSON Converter

Welcome to the TOML to JSON Converter, a free online tool that turns any TOML configuration into clean, valid JSON in a single click. Whether you are migrating Cargo.toml to a JSON-based pipeline, debugging deeply nested settings visually, or feeding a TOML file into a service that only accepts JSON, this converter handles every TOML construct correctly: tables, sub-tables, arrays of tables, inline tables, dotted keys, multi-line strings, hex/octal/binary integers, dates, and special floats. Pick the output style that fits your workflow — pretty 2-space, pretty 4-space, compact, or sorted-by-key — and inspect the result through a structure tree, a stats dashboard, and a transformation diagram.

What is TOML and Why Convert It to JSON?

TOML (Tom's Obvious Minimal Language) is a configuration format designed to be unambiguous and easy for humans to read. It powers package metadata for Cargo (Rust), Poetry (Python), and many other developer tools. JSON, on the other hand, is the universal data interchange format on the web. Many systems — REST APIs, document databases, browser localStorage, and JavaScript apps — only speak JSON. Converting TOML to JSON lets you bridge these two worlds without rewriting your config.

Common Reasons to Convert TOML to JSON

  • Pipe TOML into a JSON-only API — for example, a deployment service or a feature-flag platform.
  • Inspect deeply nested config visually — JSON's bracket-and-brace structure makes hierarchy obvious at a glance.
  • Generate front-end config bundles — keep your authoring format in TOML, ship JSON to the browser.
  • Work with linters and JSON Schema — validate TOML structure by routing it through a JSON Schema validator.
  • Compare configurations — diff sorted-key JSON between environments to spot drift.
  • Migrate legacy config — gradually port a TOML file into a JSON-backed config service.

Key Features of This Converter

  • Full TOML 1.0 coverage — basic and literal strings (single and multi-line), integers in decimal/hex/octal/binary with underscore separators, floats with scientific notation, inf, -inf, nan, booleans, dates and datetimes.
  • Nested structures — tables, sub-tables ([a.b.c]), arrays of tables ([[a]]), inline tables ({ a = 1, b = 2 }), and dotted keys.
  • Four output styles — pretty 2-space, pretty 4-space, compact (minified), and sorted keys for diff-friendly output.
  • Visual structure tree — see how TOML constructs become JSON objects and arrays, with type badges (table, AoT, array, string, number, bool).
  • Statistics dashboard — count of tables, keys, arrays, arrays of tables, depth, plus input/output character counts.
  • Line-aware error messages — every parsing error includes the exact line number so you can fix it instantly.
  • One-click sample library — load Cargo.toml-style, pyproject-style, application-config, numbers, or multi-line-string examples.
  • Copy and download — copy JSON to clipboard or download as a .json file.
  • Mobile responsive — works comfortably on phones, tablets, and desktop.
  • No data leaves your browser request — TOML is parsed server-side and the result is returned in the same response; nothing is stored.

How TOML Maps to JSON

Most TOML constructs have a clean, lossless JSON equivalent. Here is the mapping the converter applies:

TOML constructJSON equivalentNotes
key = "string""key": "string"Basic strings keep escape sequences; literal strings are verbatim.
key = 42"key": 42Decimal, hex (0x), octal (0o), and binary (0b) integers all become JSON numbers.
key = 3.14"key": 3.14Floats keep their precision; inf/nan become null for valid JSON.
key = true"key": trueBooleans map directly.
key = 2026-04-25T12:00:00Z"key": "2026-04-25T12:00:00Z"JSON has no datetime type, so the RFC 3339 string is preserved.
key = [1, 2, 3]"key": [1, 2, 3]Arrays become JSON arrays.
[table]
k = 1
"table": { "k": 1 }Tables become objects.
[a.b.c]
k = 1
"a": { "b": { "c": { "k": 1 } } }Sub-tables nest implicitly.
[[items]]
k = 1
"items": [{ "k": 1 }]Array of tables becomes an array of objects.
k = { a = 1, b = 2 }"k": { "a": 1, "b": 2 }Inline tables are equivalent to JSON objects.
a.b.c = 1"a": { "b": { "c": 1 } }Dotted keys create implicit nesting.

Examples

TOML input
title = "App"
[server]
host = "localhost"
port = 8080
JSON output
{
  "title": "App",
  "server": {
    "host": "localhost",
    "port": 8080
  }
}
TOML input (array of tables)
[[user]]
name = "Alice"
admin = true

[[user]]
name = "Bob"
admin = false
JSON output
{
  "user": [
    { "name": "Alice", "admin": true },
    { "name": "Bob",   "admin": false }
  ]
}
TOML input (dotted keys + inline)
db.host = "10.0.0.1"
db.port = 5432
db.options = { ssl = true, pool = 20 }
JSON output
{
  "db": {
    "host": "10.0.0.1",
    "port": 5432,
    "options": { "ssl": true, "pool": 20 }
  }
}

How to Use the TOML to JSON Converter

  1. Paste your TOML into the input box, or click a Quick Sample chip to load a typical configuration.
  2. Choose an output style — pretty 2-space (default), pretty 4-space, compact, or sorted keys.
  3. Click Convert to JSON. The tool parses the TOML and renders the JSON output with statistics and a structure tree.
  4. Inspect the result — review the stats dashboard for an at-a-glance summary, expand the structure tree to see the hierarchy, and read the conversion diagram to understand the mapping.
  5. Copy or download the JSON. The Copy button puts it on your clipboard; Download saves it as converted.json.

TOML Features Supported

Strings

  • Basic strings use double quotes and support escape sequences: \n, \t, \r, \", \\, \uXXXX, \UXXXXXXXX.
  • Literal strings use single quotes and contain raw characters with no escapes.
  • Multi-line basic strings use triple double quotes (""") and support line-ending backslash to trim whitespace.
  • Multi-line literal strings use triple single quotes (''') and preserve everything verbatim.

Numbers

  • Decimal integers with optional underscore separators: 1_000_000.
  • Hex/octal/binary integers: 0xDEADBEEF, 0o755, 0b1010.
  • Floats with optional sign, decimal, and exponent: 3.14, -2e-3, 6.022e23.
  • Special floats: inf, -inf, nan (converted to JSON null).

Tables and Arrays

  • Tables: [name] opens a new table.
  • Sub-tables: [a.b.c] creates nested tables.
  • Arrays of tables: [[name]] appends a new table to an array.
  • Inline tables: { a = 1, b = 2 }.
  • Arrays: [1, 2, 3] can span multiple lines and contain mixed value types.

Choosing the Right Output Style

  • Pretty 2-space — the default. Compact yet readable; ideal for most uses including config files committed to git.
  • Pretty 4-space — matches PEP-8 style indentation; preferred by some Python and Java teams.
  • Compact (minified) — single line, no extra whitespace; smallest payload for transmission over the network.
  • Sorted keys — pretty output with keys sorted alphabetically. Excellent for diffs because identical configs always produce byte-identical output regardless of key order.

Frequently Asked Questions

What is TOML and why convert it to JSON?

TOML is a config format designed to be obvious and minimal. Converting it to JSON lets you feed configurations into JSON-only systems, debug nested structure visually, share with web APIs, and integrate with JavaScript code that expects JSON.

Does this converter handle arrays of tables and inline tables?

Yes. The converter fully supports the [[array.of.tables]] syntax (translated to JSON arrays of objects), inline tables like { a = 1, b = 2 } (translated to JSON objects), nested sub-tables, dotted keys, and arbitrary nesting depth.

What output styles are supported?

Four styles: Pretty 2-space (the default, ideal for reading), Pretty 4-space (matches PEP-8 style indentation), Compact (minified single-line JSON, smallest size), and Sorted Keys (pretty output with keys sorted alphabetically for diff-friendliness).

How are TOML datetimes converted to JSON?

JSON has no native datetime type, so TOML datetimes (RFC 3339 format like 2026-04-25T12:00:00Z) are preserved as strings in the JSON output. Local dates, local times, and offset datetimes are all kept verbatim, ready to parse back with any datetime library.

What happens with TOML inf and nan values?

Standard JSON does not allow Infinity or NaN literals, so non-finite floats from TOML (inf, -inf, nan) are converted to null in the JSON output. This produces output that strictly conforms to RFC 8259 and parses correctly in every JSON library.

Where do parsing errors come from and how do I fix them?

The converter reports the exact line where parsing failed along with a description of the problem (unterminated string, duplicate key, missing equals sign, malformed array, etc.). Common causes are unbalanced quotes or brackets, mixing tabs in unexpected places, and accidentally redefining a table that was already defined earlier.

Is there a size limit?

The tool can handle TOML files several megabytes in size comfortably. For very large config files, performance is dominated by browser rendering, not parsing.

Is my TOML data sent anywhere or stored?

Your input is parsed server-side to produce the JSON output and then discarded. We do not log, store, or transmit your configuration anywhere else.

Can I convert JSON back to TOML?

This tool is one-way (TOML → JSON). For the reverse direction, use a JSON-to-TOML converter or a programming library like Python's tomli_w, JavaScript's @iarna/toml, or Rust's toml crate.

Tips for Clean Conversions

  • Use sorted-key output for diffs — your version-controlled JSON will be stable across team members.
  • Prefer multi-line strings (""" or ''') for paragraphs of text rather than concatenating with \n escapes.
  • Group related keys with tables — they are more readable than long dotted keys.
  • Watch for accidental table redefinition — TOML disallows defining the same table twice; the converter catches this with a clear error.
  • Keep dates and times in RFC 3339 — local-only formats also parse, but RFC 3339 round-trips cleanly through JSON consumers.

Additional Resources

Reference this content, page, or tool as:

"TOML to JSON Converter" at https://MiniWebtool.com/toml-to-json-converter/ from MiniWebtool, https://MiniWebtool.com/

by miniwebtool team. Updated: Apr 25, 2026

Related MiniWebtools:

Other Text Tools:

Top & Updated:

Random PickerRandom Name PickerFeet and Inches to Cm ConverterRemove SpacesERA CalculatorRelative Standard Deviation CalculatorSort NumbersBatting Average CalculatorLine CounterBitwise CalculatorMAC Address GeneratorRandom Quote GeneratorRoman Numerals ConverterWord to Phone Number ConverterSHA256 Hash GeneratorSum CalculatorPercent Off CalculatorPhone Number ExtractorCompound Growth CalculatorFPS ConverterLog Base 10 CalculatorSun, Moon & Rising Sign Calculator 🌞🌙✨Octal CalculatorCm to Feet and Inches ConverterText FormatterQuotient and Remainder CalculatorSlugging Percentage CalculatorMAC Address LookupOn Base Percentage CalculatorEmail ExtractorBinary to Gray Code ConverterRemove AccentURL ExtractorDecimal to BCD ConverterAdd Prefix and Suffix to TextSalary Conversion CalculatorFacebook User ID LookupBCD to Decimal ConverterOPS CalculatorNumber of Digits CalculatorWHIP CalculatorGray Code to Binary ConverterRandom Birthday GeneratorAI ParaphraserLove Compatibility CalculatorMP3 LooperAI Punctuation AdderSHA512 Hash GeneratorPercent Growth Rate CalculatorCompare Two StringsList of Prime NumbersSquare Root (√) CalculatorDay of the Year Calculator - What Day of the Year Is It Today?Video CompressorBinary to BCD ConverterVideo to Image ExtractorOutlier CalculatorIP Address to Hex ConverterSort Lines AlphabeticallyHex to BCD ConverterFirst n Digits of PiDay of Year CalendarBCD to Binary ConverterLottery Number GeneratorBCD to Hex ConverterMedian CalculatorStandard Error CalculatorLeap Years ListList RandomizerBreak Line by CharactersAverage CalculatorModulo CalculatorPVIFA CalculatorReverse VideoWAR CalculatorHypotenuse CalculatorRemove Audio from VideoActual Cash Value CalculatorScientific Notation to Decimal ConverterNumber ExtractorAngel Number CalculatorLog Base 2 CalculatorRoot Mean Square CalculatorSum of Positive Integers CalculatorSHA3-256 Hash GeneratorAI Sentence Expander📅 Date CalculatorLbs to Kg ConverterTime Duration CalculatorHex to Decimal ConverterRandom Group GeneratorConvolution CalculatorMAC Address AnalyzerRandom String GeneratorRemove Leading Trailing SpacesAmortization CalculatorMarkup CalculatorPVIF CalculatorName Number CalculatorDecimal to Hex ConverterInstagram Font GeneratorSocial Media Image Size GuideTikTok Money CalculatorYouTube Channel StatisticsTwitter/X Character CounterTwitter/X Timestamp ConverterYouTube Watch Time CalculatorTwitch Earnings CalculatorYouTube Shorts Monetization CalculatorFacebook Ad Cost CalculatorSocial Media ROI CalculatorSocial Media Post Time OptimizerSocial Media Username CheckerCTR CalculatorROAS CalculatorInfluencer ROI CalculatorForce CalculatorAcceleration CalculatorVelocity CalculatorMomentum CalculatorProjectile Motion CalculatorKinetic Energy CalculatorPotential Energy CalculatorWork and Power CalculatorDensity CalculatorPressure CalculatorIdeal Gas Law CalculatorFree Fall CalculatorTorque CalculatorHorsepower CalculatorDilution CalculatorChemical Equation BalancerStoichiometry CalculatorPercent Yield CalculatorEmpirical Formula CalculatorBoiling Point CalculatorTitration CalculatorMole/Gram/Particle ConverterLED Resistor CalculatorVoltage Divider CalculatorParallel Resistor CalculatorCapacitor Calculator555 Timer CalculatorWire Gauge CalculatorTransformer CalculatorRC Time Constant CalculatorPower Factor CalculatorDecibel (dB) CalculatorImpedance CalculatorResonant Frequency CalculatorGrade CalculatorFinal Grade CalculatorWeighted Grade CalculatorTest Score CalculatorSignificant Figures CalculatorStudy Timer (Pomodoro)Long Division CalculatorRounding CalculatorCompleting the Square CalculatorRatio Calculatorp-Value CalculatorNormal Distribution CalculatorPercentile CalculatorFive Number Summary CalculatorCross Multiplication CalculatorLumber CalculatorRebar CalculatorPaver CalculatorInsulation CalculatorHVAC Sizing CalculatorRetaining Wall CalculatorCarpet CalculatorSquare Footage Calculator⏱️ Countdown Timer⏱️ Online Stopwatch⏱️ Hours Calculator🕐 Military Time Converter📅 Date Difference Calculator⏰ Time Card Calculator⏰ Online Alarm Clock🌐 Time Zone Converter🌬️ Wind Chill Calculator🌡️ Heat Index Calculator💧 Dew Point CalculatorFuel Cost CalculatorTire Size Calculator👙 Bra Size Calculator🌍 Carbon Footprint Calculator⬛ Aspect Ratio CalculatorOnline Notepad🖱️ Click Counter🔊 Tone Generator📊 Bar Graph Maker🥧 Pie Chart Maker📈 Line Graph Maker📷 OCR / Image to Text🔍 Plagiarism Checker🚚 Moving Cost Estimator❄️ Snow Day Calculator🎮 Game Sensitivity Converter⚔️ DPS Calculator🎰 Gacha Pity Calculator🎲 Loot Drop Probability Calculator🎮 In-Game Currency ConverterMultiplication Table GeneratorLong Multiplication CalculatorLong Addition and Subtraction CalculatorOrder of Operations Calculator (PEMDAS)Place Value Chart GeneratorNumber Pattern FinderEven or Odd Number CheckerAbsolute Value CalculatorCeiling and Floor Function CalculatorUnit Rate CalculatorSkip Counting GeneratorNumber to Fraction ConverterEstimation CalculatorCubic Equation SolverQuartic Equation SolverLogarithmic Equation SolverExponential Equation SolverTrigonometric Equation SolverLiteral Equation SolverRational Equation SolverSystem of Nonlinear Equations SolverPoint-Slope Form CalculatorStandard Form to Slope-Intercept ConverterEquation of a Line CalculatorParallel and Perpendicular Line CalculatorDescartes' Rule of Signs CalculatorRational Root Theorem CalculatorSigma Notation Calculator (Summation)Product Notation Calculator (Pi Notation)Pascal's Triangle GeneratorBinomial Theorem Expansion CalculatorParabola CalculatorHyperbola CalculatorConic Section IdentifierRegular Polygon CalculatorIrregular Polygon Area CalculatorFrustum CalculatorTorus Calculator3D Distance CalculatorGreat Circle Distance CalculatorCircumscribed Circle (Circumcircle) CalculatorInscribed Circle (Incircle) CalculatorAngle Bisector CalculatorTangent Line to Circle CalculatorHeron's Formula CalculatorCoordinate Geometry Distance CalculatorVolume of Revolution CalculatorSurface of Revolution CalculatorParametric Curve GrapherRiemann Sum CalculatorTrapezoidal Rule CalculatorSimpson's Rule CalculatorImproper Integral CalculatorL'Hôpital's Rule CalculatorMaclaurin Series CalculatorPower Series CalculatorSeries Convergence Test CalculatorInfinite Series Sum CalculatorAverage Rate of Change CalculatorInstantaneous Rate of Change CalculatorRelated Rates SolverOptimization Calculator (Calculus)Gradient Calculator (Multivariable)Divergence CalculatorCurl CalculatorLine Integral CalculatorSurface Integral CalculatorJacobian Matrix CalculatorNewton's Method CalculatorRREF Calculator (Row Echelon Form)Matrix Inverse CalculatorMatrix Multiplication CalculatorDot Product CalculatorCross Product CalculatorVector Magnitude CalculatorUnit Vector CalculatorAngle Between Vectors CalculatorNull Space CalculatorColumn Space CalculatorCramer's Rule CalculatorMatrix Diagonalization CalculatorQR Decomposition CalculatorCholesky Decomposition CalculatorMatrix Power CalculatorCharacteristic Polynomial CalculatorBayes' Theorem CalculatorF-Test / F-Distribution CalculatorHypergeometric Distribution CalculatorNegative Binomial Distribution CalculatorGeometric Distribution CalculatorExponential Distribution CalculatorWeibull Distribution CalculatorBeta Distribution CalculatorSpearman Rank Correlation CalculatorFisher's Exact Test CalculatorContingency Table CalculatorOdds Ratio CalculatorRelative Risk CalculatorEffect Size CalculatorPermutations with Repetition CalculatorModular Exponentiation CalculatorPrimitive Root CalculatorPerfect Number CheckerAmicable Number CheckerTwin Prime FinderMersenne Prime CheckerGoldbach Conjecture VerifierMöbius Function CalculatorEgyptian Fraction CalculatorFibonacci Number CheckerDigital Root CalculatorPartition Function CalculatorBoolean Algebra SimplifierKarnaugh Map (K-Map) SolverLogic Gate SimulatorGraph Coloring CalculatorTopological Sort CalculatorAdjacency Matrix CalculatorRecurrence Relation SolverInclusion-Exclusion CalculatorLinear Programming SolverTraveling Salesman Solver (TSP)Hamiltonian Path CheckerPlanar Graph CheckerNetwork Flow Calculator (Max Flow)Stable Marriage Problem SolverFirst-Order ODE SolverSecond-Order ODE SolverDirection Field / Slope Field PlotterEuler's Method CalculatorBernoulli ODE SolverSystem of ODEs SolverGroup Theory Order CalculatorRing and Field CalculatorJordan Normal Form CalculatorMatrix Exponential CalculatorTensor Product CalculatorFast Fourier Transform (FFT) CalculatorZ-Transform CalculatorNumerical Integration CalculatorTOML to JSON ConverterJSON to CSV ConverterXML to JSON ConverterSQL to MongoDB Query ConverterCSS Flexbox Playground