Chuyển TOML sang JSON

Cần chuyển đổi ngược không?
JSON to TOML Converter

Đầu vào: TOML

1

Đầu ra: JSON

Nhập dữ liệu TOML để chuyển đổi sang JSON

Dữ liệu đã chuyển đổi sẽ hiển thị ở đây

Cách chuyển TOML sang JSON

  1. Bước 1 – Dán cấu hình TOML

    • Dán cặp key-value TOML, [sections] hoặc [[array_tables]] vào editor.
    • Giá trị có thể là chuỗi, số, boolean, mảng hoặc ngày tháng.
    • Bạn cũng có thể import file .toml từ máy tính.
  2. Bước 2 – Kiểm tra JSON

    • Công cụ chuyển ngữ nghĩa TOML thành object JSON hợp lệ.
    • Ngày (RFC 3339) được giữ dưới dạng chuỗi, và kiểu dữ liệu được giữ khi có thể.
    • Xác nhận cấu trúc bảng được biểu diễn như thuộc tính JSON lồng nhau.
  3. Bước 3 – Xuất output

    • Sao chép JSON để dùng trong ứng dụng JavaScript/TypeScript.
    • Tải xuống file .json cho migration dữ liệu hoặc dùng trong API.
Example: TOML to JSON
# Input TOML
title = "TOML Example"

[owner]
name = "Tom Preston-Werner"

// Output JSON
{
  "title": "TOML Example",
  "owner": {
    "name": "Tom Preston-Werner"
  }
}

Related tools

Câu hỏi thường gặp

What is TOML format?

TOML (Tom's Obvious Minimal Language) is a configuration file format that's easy to read due to obvious semantics. It's designed to map unambiguously to a hash table.

How are TOML sections converted?

TOML sections [section] become nested JSON objects. Dotted keys like 'database.host' create nested structures automatically.

What TOML features are supported?

The converter supports strings, numbers, booleans, arrays, inline tables, nested sections, and basic date/time parsing. Complex multiline strings and advanced TOML features may have limited support.

Are array tables supported?

Yes. Array tables [[products]] are converted to JSON arrays containing objects, which is useful for representing repeated configuration blocks.

Is my data secure?

Yes, all data processing happens entirely in your browser. Your data is never sent to any server, ensuring complete privacy and security.

Chuyển TOML sang JSON | JSONSwiss