Diysb Tools

Stringify JSON

Converta objetos JavaScript para o formato de string JSON. Serialize estruturas de dados em strings JSON para armazenamento ou transmissão.

Ferramentas JSON
Entrada de Objeto/Array JavaScript
Saída de String JSON
Opções de ferramentas
Configurações de indentação
Usar espaços
Indentar saída com espaços
Usar tabs
Indentar saída com tabs
Opções de escape
Escapar caracteres HTML especiais na string JSON
Stringify JSON Exemplos

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 }
Configurações de indentação
Usar espaços
Indentar saída com espaços
Usar tabs
Indentar saída com tabs
Opções de escape
Escapar caracteres HTML especiais na string JSON

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 } ]
Configurações de indentação
Usar espaços
Indentar saída com espaços
Usar tabs
Indentar saída com tabs
Opções de escape
Escapar caracteres HTML especiais na string JSON

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; }
Configurações de indentação
Usar espaços
Indentar saída com espaços
Usar tabs
Indentar saída com tabs
Opções de escape
Escapar caracteres HTML especiais na string JSON