Diysb Tools

JSONを文字列化する

JavaScriptオブジェクトをJSON文字列形式に変換します。データ構造をJSON文字列にシリアル化して保存または転送します。

JSONツール
JavaScriptオブジェクト/配列入力
JSON文字列出力
ツールオプション
インデント設定
スペースを使用
スペースで出力をインデントする
タブを使用
タブで出力をインデントする
エスケープ設定
HTML特殊文字 (<、>、&、') をエスケープシーケンス (&lt;、&gt;、&amp;、&#39;) に置き換える
JSONを文字列化する 例

Simple Object to JSON

Convert a basic JavaScript object into a JSON string.

{ name: "John", age: 30 }
{ name: "John", age: 30 }
{ "name": "John", "age": 30 }
{ "name": "John", "age": 30 }
インデント設定
スペースを使用
スペースで出力をインデントする
タブを使用
タブで出力をインデントする
エスケープ設定
HTML特殊文字 (<、>、&、') をエスケープシーケンス (&lt;、&gt;、&amp;、&#39;) に置き換える

Array with Mixed Types

Convert an array containing different types of values into JSON.

[1, "hello", true, null, { x: 10 }]
[1, "hello", true, null, { x: 10 }]
[ 1, "hello", true, null, { "x": 10 } ]
[ 1, "hello", true, null, { "x": 10 } ]
インデント設定
スペースを使用
スペースで出力をインデントする
タブを使用
タブで出力をインデントする
エスケープ設定
HTML特殊文字 (<、>、&、') をエスケープシーケンス (&lt;、&gt;、&amp;、&#39;) に置き換える

HTML-Escaped JSON

Convert an object to JSON with HTML characters escaped.

{ html: "<div>Hello & Welcome</div>", message: "Special chars: > & ' \"" }
{ html: "<div>Hello & Welcome</div>", message: "Special chars: > & ' \"" }
{ &quot;html&quot;: &quot;&lt;div&gt;Hello &amp; Welcome&lt;/div&gt;&quot;, &quot;message&quot;: &quot;Special chars: &lt; &gt; &amp; &#039; &quot;&quot; }
{ &quot;html&quot;: &quot;&lt;div&gt;Hello &amp; Welcome&lt;/div&gt;&quot;, &quot;message&quot;: &quot;Special chars: &lt; &gt; &amp; &#039; &quot;&quot; }
インデント設定
スペースを使用
スペースで出力をインデントする
タブを使用
タブで出力をインデントする
エスケープ設定
HTML特殊文字 (<、>、&、') をエスケープシーケンス (&lt;、&gt;、&amp;、&#39;) に置き換える