Diysb Tools

Stringify JSON

Converteer JavaScript-objecten naar JSON-stringformaat. Serialiseer datastructuren naar JSON-strings voor opslag of verzending.

JSON-hulpmiddelen
JavaScript Object/Array Invoer
JSON String Uitvoer
Gereedschapsopties
Inspringingsinstellingen
Gebruik spaties
Inspringen met spaties
Gebruik tabs
Inspringen met tabs
Escape opties
Speciale HTML-tekens in JSON-string escapen
Stringify JSON Voorbeelden

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 }
Inspringingsinstellingen
Gebruik spaties
Inspringen met spaties
Gebruik tabs
Inspringen met tabs
Escape opties
Speciale HTML-tekens in JSON-string escapen

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 } ]
Inspringingsinstellingen
Gebruik spaties
Inspringen met spaties
Gebruik tabs
Inspringen met tabs
Escape opties
Speciale HTML-tekens in JSON-string escapen

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; }
Inspringingsinstellingen
Gebruik spaties
Inspringen met spaties
Gebruik tabs
Inspringen met tabs
Escape opties
Speciale HTML-tekens in JSON-string escapen