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 PickerInstagram User ID LookupLine CounterFPS ConverterSort NumbersRelative Standard Deviation CalculatorBatting Average CalculatorMAC Address GeneratorRemove SpacesERA CalculatorFeet and Inches to Cm ConverterWord to Phone Number ConverterFacebook User ID LookupRandom Truth or Dare GeneratorMAC Address LookupImage ResizerSum CalculatorSun, Moon & Rising Sign Calculator 🌞🌙✨Job FinderPercent Off CalculatorSlope and Grade CalculatorNumber of Digits CalculatorRandom Credit Card GeneratorBitwise CalculatorSHA256 Hash GeneratorSquare Root (√) CalculatorMP3 LooperVertical Jump CalculatorAudio SplitterLog Base 10 CalculatorOPS CalculatorRandom IMEI GeneratorRoman Numerals Converter⬛ Aspect Ratio CalculatorInvisible Text GeneratorSalary Conversion CalculatorMaster Number CalculatorSlugging Percentage CalculatorMerge VideosRandom Quote GeneratorCm to Feet and Inches ConverterRandom Activity GeneratorRandom Loadout GeneratorAI Text HumanizerPhone Number ExtractorSaturn Return CalculatorRandom Object GeneratorText FormatterRandom Fake Address GeneratorFile Size ConverterRandom Superpower GeneratorRandom Movie PickerNumber to Word ConverterCaffeine Overdose Calculator📷 OCR / Image to TextOn Base Percentage CalculatorDecimal to BCD ConverterHalfway Date CalculatorRandom Poker Hand GeneratorRandom Meal GeneratorWord Ladder GeneratorCompound Growth CalculatorCM to Inches ConverterConnect the Dots GeneratorCompare Two StringsOctal CalculatorPerfect Number CheckerWHIP CalculatorLove Compatibility CalculatorSteel Weight CalculatorFirst n Digits of PiRandom Writing Prompt GeneratorBinary to Gray Code ConverterArc Length CalculatorPercent Growth Rate CalculatorVideo to Image ExtractorBCD to Decimal ConverterYouTube Channel StatisticsPER CalculatorProportion Calculator📅 Date CalculatorStair CalculatorIP Subnet CalculatorRandom Birthday GeneratorTime Duration CalculatorBattery Life CalculatorQuotient and Remainder CalculatorBingo Card GeneratorLeap Years ListGrade CalculatorSocial Media Username CheckerAcreage CalculatorOutlier CalculatorDay of the Year Calculator - What Day of the Year Is It Today?WAR CalculatorGray Code to Binary ConverterAstrological Element Balance CalculatorImage SplitterLong Division CalculatorMartingale Strategy CalculatorSHA512 Hash GeneratorVideo CompressorAdd Text to Image🔍 Plagiarism CheckerRemove AccentImage CompressorIP Address to Hex ConverterClothing Size ConverterAdd Prefix and Suffix to TextWhat is my Lucky Number?Trigonometric Equation SolverAI Punctuation AdderBinary to BCD ConverterSmall Text Generator ⁽ᶜᵒᵖʸ ⁿ ᵖᵃˢᵗᵉ⁾List of Prime NumbersModulo CalculatorURL ExtractorRatio to Percentage CalculatorRemove Leading Trailing SpacesRandom Time Generator🖱️ Click CounterNumber ExtractorWeight Loss CalculatorBroken Link CheckerRandom Letter Generator🎰 Gacha Pity CalculatorLottery Number GeneratorBoiling Point CalculatorSum of Positive Integers CalculatorHow Long Ago CalculatorMultiple Fraction CalculatorMercury Retrograde CalendarRandom Chess Opening GeneratorBreak Line by CharactersAngel Number CalculatorTaco Bar CalculatorBirth Day of the Week CalculatorBolt Torque CalculatorMandelbrot Set ExplorerWhat is my Zodiac Sign?Cone Flat Pattern (Template) GeneratorEmail ExtractorHypotenuse CalculatorRandom Emoji GeneratorMorse Code GeneratorMolarity CalculatorSquare Numbers ListDay of Year CalendarAI ParaphraserBCD to Binary ConverterVideo SplitterHeight Percentile CalculatorYouTube Comment PickerName Number Calculator🔊 Tone GeneratorWord Scramble GeneratorBonus CalculatorRandom Tournament Bracket GeneratorYouTube Tag ExtractorRandom Chord GeneratorPVIF CalculatorHex to BCD ConverterRadical SimplifierRandom Number PickerBcrypt Hash Generator / CheckerDice Roll Probability CalculatorHappy Number CalculatorAI Language DetectorAge CalculatorList Randomizer⏱️ Hours CalculatorText to Speech ReaderRandom Playing Card GeneratorConvolution CalculatorRandom Group GeneratorkPa to psi ConverterExponential Decay CalculatorMAC Address AnalyzerTDEE CalculatorRatio CalculatorShort Selling Profit CalculatorRoof Pitch CalculatorCrossword Puzzle MakerInvisible Character RemoverList CleanerAdjust Video SpeedGrams to Pounds ConverterSort Text By LengthDMS to Decimal Degrees ConverterNumber Pattern FinderRemove Audio from VideoDecking CalculatorYouTube Earnings EstimatorColor InverterFlip VideoPVIFA CalculatorAmortization CalculatorSort Lines AlphabeticallyBCD to Hex ConverterMedian CalculatorStandard Error CalculatorAverage CalculatorReverse VideoActual Cash Value CalculatorScientific Notation to Decimal ConverterLog Base 2 CalculatorRoot Mean Square CalculatorSHA3-256 Hash GeneratorAI Sentence ExpanderLbs to Kg ConverterHex to Decimal ConverterRandom String GeneratorMarkup CalculatorDecimal to Hex ConverterInstagram Font GeneratorSocial Media Image Size GuideTikTok Money CalculatorTwitter/X Character CounterTwitter/X Timestamp ConverterYouTube Watch Time CalculatorTwitch Earnings CalculatorYouTube Shorts Monetization CalculatorFacebook Ad Cost CalculatorSocial Media ROI CalculatorSocial Media Post Time OptimizerCTR 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 CalculatorTitration CalculatorMole/Gram/Particle ConverterIrregular 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 CalculatorTip Splitter (Advanced)Lease vs Buy CalculatorHourly Rate Calculator (Freelancer)Invoice Late Fee CalculatorESPP CalculatorStock Split CalculatorOptions Probability CalculatorDollar to Gold ConverterBeam Load CalculatorPipe Flow CalculatorGravel, Sand & Topsoil CalculatorRandom Sentence GeneratorRandom Paragraph GeneratorRandom Math Problem GeneratorRandom Bible Verse GeneratorRandom Cat/Dog Name GeneratorRandom Debate Topic GeneratorBody Recomposition CalculatorAlcohol Calorie CalculatorMedication Dosage CalculatorPace to Calories CalculatorHydration CalculatorTrain Meeting Problem SolverAge Word Problem SolverMixture Problem SolverWork Rate Problem SolverDistance-Speed-Time Triangle CalculatorCoin Word Problem SolverNumber Bonds GeneratorCarry and Borrow VisualizerTimes Tables QuizMental Math TrainerRoman Numeral Math SolverEgyptian Multiplication CalculatorVedic Math Tricks CalculatorRussian Peasant MultiplicationSoroban Abacus SimulatorAnnuity Payout CalculatorReverse Mortgage CalculatorVariable Annuity CalculatorFixed Indexed Annuity CalculatorBond Convexity CalculatorBond Duration Calculator (Macaulay & Modified)Forward Rate CalculatorMortgage Recast CalculatorTreasury Inflation-Protected Securities (TIPS) CalculatorStock Beta CalculatorTreynor Ratio CalculatorSortino Ratio CalculatorDoppler Effect CalculatorSpring Constant CalculatorPendulum Period CalculatorCentripetal Force CalculatorAngular Velocity CalculatorMoment of Inertia CalculatorSnell's Law CalculatorCoulomb's Law CalculatorElectric Field CalculatorMagnetic Field of Wire CalculatorLens Equation CalculatorA/B Test Significance CalculatorA/B Test Sample Size CalculatorConversion Rate CalculatorCustomer Lifetime Value (CLV) CalculatorCustomer Acquisition Cost (CAC) CalculatorChurn Rate CalculatorRetention Rate Cohort CalculatorNPS (Net Promoter Score) CalculatorPareto Chart GeneratorSix Sigma Process Capability CalculatorTessellation GeneratorSpirograph GeneratorVoronoi Diagram GeneratorDelaunay Triangulation GeneratorL-System Fractal GeneratorJulia Set GeneratorPolar Equation Plotter3D Surface PlotterSierpinski Triangle GeneratorcURL Command BuilderHTTP Status Code ReferenceUUID Validator/DecoderURL ParserQuery String BuilderSVG to React/JSX ConverterSCSS to CSS CompilerLess to CSS CompilerTypeScript PlaygroundJSON Schema GeneratorImage to ASCII Art ConverterImage to SVG TracerLipogram CheckerPangram CheckerAcronym GeneratorBackronym GeneratorPig Latin TranslatorEXIF Data Viewer/RemoverROT13 Encoder/DecoderAtbash Cipher ToolVigenère Cipher ToolPronunciation IPA ConverterHemingway-Style Readability EditorSentence Length Variance AnalyzerWord Frequency AnalyzerBusiness Days CalculatorAdd Business Days to DateDate Pattern GeneratorHow Long Until CalculatorBirthday Across Cultures CalculatorLunar Calendar ConverterHijri Calendar ConverterHebrew Calendar ConverterInsulin Sensitivity Factor CalculatorCarb-to-Insulin Ratio CalculatorLean Body Mass to Strength CalculatorOne-Mile Walk Test (Rockport) CalculatorCooper 12-Minute Run CalculatorFFMI CalculatorAPGAR Score CalculatorGlasgow Coma Scale CalculatorWells Score Calculator (DVT/PE)Tennis Score TrackerSoccer xG (Expected Goals) CalculatorCricket Run Rate CalculatorRugby Points CalculatorBoxing Punch Power CalculatorRace Time PredictorSwimming SWOLF CalculatorYoga Pose Hold TimerFishing Knot Strength CalculatorBike Gear Ratio CalculatorClimbing Grade ConverterWine Pairing SuggesterStandard Drink CalculatorCaffeine Half-Life TrackerSpice Substitution FinderDietary Restriction Recipe FilterMarinade Time CalculatorFermentation Time CalculatorSmoking Wood Pairing GuideFreelance Project Pricing CalculatorSaaS Pricing CalculatorSubscription Cost TrackerSide Hustle ROI Calculator