T
THINKFORU
Submit Feedback

TOML to JSON/YAML Converter: Online Parser

TOML to JSON/YAML Converter: Online Parser

TOML to JSON / YAML Converter

Save on Google
Tip: drag and drop a .toml file onto the input box.
// Output appears here
Related Developer Tools
Tool NameExplanation
JSON to Go Struct ConverterGenerates idiomatic Go structs with json tags from any JSON payload.
JSON to TypeScript InterfaceGenerates typed TypeScript interfaces from any JSON payload.
HTML to JSX ConverterConverts HTML markup into valid React JSX (className, self-closing tags, style objects).
Binary to Text ConverterDecodes binary (0s and 1s) into readable text and back.
Base64 Encode / DecodeEncodes text or files to Base64 and decodes Base64 strings instantly.

TOML vs JSON vs YAML Syntax Equivalence & Key-Value Spec Table

Data ConceptTOML SyntaxJSON EquivalentYAML Equivalent
Comment# notenot supported# note
Key-value pairname = "app""name": "app"name: app
Bare keyserver_port = 8080"server_port": 8080server_port: 8080
Quoted key"my key" = 1"my key": 1"my key": 1
Dotted keya.b.c = 1{"a": {"b": {"c": 1}}}a:
b:
c: 1
Basic strings = "hi\n""s": "hi\n"s: "hi\n"
Literal stringp = 'C:\path'"p": "C:\\path"p: 'C:\path'
Multi-line basic strings = """
line1
line2"""
"s": "line1\nline2"s: |-
line1
line2
Multi-line literal strings = '''
raw \n text'''
"s": "raw \\n text"s: 'raw \n text'
Line-ending backslashs = """a \
b"""
"s": "a b"s: a b
Unicode escapes = "\u00E9""s": "é"s: "é"
Integern = 42"n": 42n: 42
Signed integern = +99"n": 99n: 99
Underscore separatorsn = 1_000_000"n": 1000000n: 1000000
Hexadecimaln = 0xFF"n": 255n: 255
Octaln = 0o755"n": 493n: 493
Binaryn = 0b1010"n": 10n: 10
Floatf = 3.14"f": 3.14f: 3.14
Float with exponentf = 6.02e23"f": 6.02e+23f: 6.02e+23
Whole-number floatf = 5.0"f": 5.0f: 5.0
Infinityf = infnot representablef: .inf
Not a numberf = nannot representablef: .nan
Booleanok = true"ok": trueok: true
Offset date-timet = 1979-05-27T07:32:00Z"t": "1979-05-27T07:32:00Z"t: 1979-05-27T07:32:00Z
Offset with timezonet = 1979-05-27T00:32:00-07:00"t": "1979-05-27T00:32:00-07:00"t: 1979-05-27T00:32:00-07:00
Local date-timet = 1979-05-27T07:32:00"t": "1979-05-27T07:32:00"t: 1979-05-27T07:32:00
Local dated = 1979-05-27"d": "1979-05-27"d: 1979-05-27
Local timet = 07:32:00"t": "07:32:00"t: "07:32:00"
Arrayports = [8000, 8001]"ports": [8000, 8001]ports: [8000, 8001]
Multi-line arrayhosts = [
"a",
"b",
]
"hosts": ["a", "b"]hosts:
- a
- b
Mixed-type arraym = [1, "a", true]"m": [1, "a", true]m: [1, a, true]
Nested arraym = [[1, 2], [3]]"m": [[1, 2], [3]]m:
- [1, 2]
- [3]
Empty arraye = []"e": []e: []
Table[server]
host = "x"
{"server": {"host": "x"}}server:
host: x
Nested table[a.b]
c = 1
{"a": {"b": {"c": 1}}}a:
b:
c: 1
Spaced table header[ a . b ]{"a": {"b": {}}}a:
b: {}
Quoted table name["a.b"]
x = 1
{"a.b": {"x": 1}}"a.b":
x: 1
Inline tablept = { x = 1, y = 2 }"pt": {"x": 1, "y": 2}pt:
x: 1
y: 2
Array of tables[[bin]]
name = "a"
[[bin]]
name = "b"
{"bin": [{"name": "a"}, {"name": "b"}]}bin:
- name: a
- name: b
Nested array of tables[[a.b]]
x = 1
{"a": {"b": [{"x": 1}]}}a:
b:
- x: 1
Sub-table of array item[[bin]]
[bin.opts]
lto = true
{"bin": [{"opts": {"lto": true}}]}bin:
- opts:
lto: true
Empty table[empty]"empty": {}empty: {}
Null valuenot supportednullnull or ~
Duplicate keyerrorallowed, last value winserror in strict parsers
Multiple documentsnot supportednot supported--- separator
Anchors and aliasesnot supportednot supported&a and *a
Indentationignoredignoredsignificant
Root valuealways a tableany valueany value
File extension.toml.json.yaml or .yml
Media typeapplication/tomlapplication/jsonapplication/yaml
Cargo manifest[dependencies]
serde = "1.0"
{"dependencies": {"serde": "1.0"}}dependencies:
serde: '1.0'
pyproject.toml[project]
name = "pkg"
{"project": {"name": "pkg"}}project:
name: pkg
Hugo configbaseURL = "https://x.com/""baseURL": "https://x.com/"baseURL: https://x.com/

Technical Q&A / FAQ Matrix

Technical Developer QuestionExact Solution & Code Snippet
How do I parse TOML in Go?import "github.com/BurntSushi/toml"; var cfg Config; _, err := toml.DecodeFile("config.toml", &cfg)
How do I read TOML in Python 3.11+?import tomllib; with open("pyproject.toml", "rb") as f: data = tomllib.load(f)
How do I deserialize TOML in Rust?let cfg: Config = toml::from_str(&std::fs::read_to_string("Cargo.toml")?)?;
How do I parse TOML in Node.js?import { parse } from 'smol-toml'; const data = parse(text);
How do I convert TOML to YAML on the command line?yq -p toml -o yaml config.toml
How do I convert a Hugo config from TOML to YAML?hugo convert toYAML -s ./site -o ./site-yaml
What happens to TOML dates in JSON?They become ISO 8601 strings. Revive them with new Date(value).
How do I represent null in TOML?TOML has no null. Omit the key, or use a sentinel such as an empty string.
Why do I get a duplicate key error?TOML forbids defining the same key or table twice. Merge the entries into one table.
What happens to inf and nan in JSON?JSON has no such numbers. This tool writes them as the strings "inf", "-inf" and "nan".