TOML to JSON Conversion
Convert TOML data to JSON format. Useful for API integration and config compatibility. Enter text or upload a file (up to 100KB) and see real-time conversion results.
How to use
About this tool
Converts TOML strings to JSON.
How to use
Paste TOML; the JSON output can be copied.
Use cases
• Converting TOML (e.g. Cargo.toml) to JSON for APIs/tools • Unifying config formats • Readability and processing
Code Examples
1# Comments are ignored
2[package]
3name = "my-app"
4version = "1.0.0"
5
6[database]
7host = "localhost"
8port = 5432
9enabled = true
10
11[[servers]]
12host = "api.example.com"
13[[servers]]
14host = "cache.example.com"1{
2 "package": {
3 "name": "my-app",
4 "version": "1.0.0"
5 },
6 "database": {
7 "host": "localhost",
8 "port": 5432,
9 "enabled": true
10 },
11 "servers": [
12 { "host": "api.example.com" },
13 { "host": "cache.example.com" }
14 ]
15}How it works
■ What is TOML? TOML (Tom's Obvious, Minimal Language) is a human-readable format for config files. It supports key=value pairs, [sections], arrays, and types such as dates, integers, floats, and booleans. It is widely used in Rust (Cargo.toml), Python (pyproject.toml), and elsewhere. ■ What is JSON? JSON (JavaScript Object Notation) represents key-value pairs, arrays, and nested objects as text. It is commonly used for API requests/responses and data exchange. ■ How conversion works The tool parses the TOML string into an intermediate object, then serializes it to formatted JSON (2-space indent). Date and datetime values are output as ISO 8601 strings. All processing runs in the browser.
Privacy and data
Conversion runs entirely in the browser; TOML and JSON are never sent to a server.
FAQ
- Q: Does this tool support GraphQL variables?
- A: Yes. Paste the query in the query field and JSON variables in the variables field. Both are formatted independently and syntax errors in either are reported.
- Q: What types of GraphQL documents are supported?
- A: Queries, mutations, subscriptions, fragments, and schema definitions (SDL) are all supported.
- Q: Can I use this to validate a query before sending it to an API?
- A: The tool checks GraphQL syntax, so structural issues (missing braces, invalid keywords) are detected. It does not validate against a specific schema, so field name errors will not be caught.
- Q: Why is the formatted output different from what my IDE produces?
- A: Different formatters may make different style choices (e.g., blank lines between fields). This tool follows the standard GraphQL formatting conventions used by the graphql-js reference library.
- Q: Does this tool send my query to a server?
- A: No. All formatting and syntax checking is done in the browser. Your query and variables are never sent to any server.
