The converter parses JSON5-style object literals, optionally sorts keys recursively, and serializes the data with @iarna/toml. Nested objects become TOML tables, primitive arrays become TOML arrays, and arrays of objects become arrays of tables.
TOML has no native null value, and the serializer omits null keys or array items. Executable JavaScript constructs such as functions, computed properties, prototypes, and undefined are not converted into TOML.
Common questions and answers about this topic.
A JSON5-style JavaScript object literal uses curly braces with quoted or unquoted keys and can include comments plus trailing commas. TOML uses a key-value syntax with tables, comments, and native date/time types. Executable JavaScript values such as functions and undefined are outside this converter's data model.
Yes, use the sort keys dropdown to alphabetically sort all TOML table keys (A to Z) or keep the original property order from your JavaScript object. The sorting is applied recursively to every nested TOML table.
TOML is widely used for configuration files including Rust's Cargo.toml, Python's pyproject.toml, Hugo site config, and many CLI tools. Its readable syntax makes it ideal for settings that humans frequently edit.
No, the JS object to TOML conversion happens entirely within your browser. Your JavaScript code is processed locally and is never sent to any remote server.