SQL から JSON への変換

逆方向の変換が必要ですか?
JSON to SQL Converter

SQL 入力

1

JSON 出力

SQL データを入力して JSON に変換

変換後のデータはここに表示されます

SQL を JSON に変換する方法

  1. ステップ 1 – SQL INSERT を貼り付ける

    • SQL ダンプ/エクスポートの INSERT INTO ... VALUES ...; を貼り付けます。
    • セミコロン区切りの複数 INSERT に対応します。
    • .sql ファイルをコンピュータからインポートできます。
  2. ステップ 2 – 変換結果を確認する

    • SQL を解析し、列名をキー、値をデータとして JSON に変換します。
    • 整数、真偽値(TRUE/FALSE)、NULL は JSON の型へ変換されます。
    • 各レコードには元テーブルを示す _table フィールドが含まれます。
  3. ステップ 3 – JSON を書き出す

    • 整形された JSON 配列をコピーして API や設定に使えます。
    • .json としてダウンロードできます。
    • 逆変換が必要なら関連ツールで JSON→SQL に戻せます。
Example: SQL to JSON
// Input SQL
INSERT INTO users (id, role) VALUES (1, 'admin');

// Output JSON
[
  {
    "id": 1,
    "role": "admin",
    "_table": "users"
  }
]

Related tools

よくある質問

What SQL statements are supported?

Currently supports INSERT INTO statements with a VALUES clause. Each INSERT statement becomes a JSON object with column names as keys and the table name stored in a _table field.

How are SQL data types converted?

NULL → null, quoted strings → strings, numbers → numbers, TRUE/FALSE → booleans. Complex values are treated as strings and may need additional parsing.

Can I process multiple INSERT statements?

Yes. The converter processes all INSERT statements in the input and creates an array of JSON objects, one for each INSERT statement.

What about other SQL statements?

Currently only INSERT statements are supported. CREATE TABLE, SELECT, UPDATE, and DELETE statements are not processed but won't cause errors.

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.

SQL から JSON への変換 | JSONSwiss