Pretty Print JSON

I used to use a website to pretty-print my JSON. But realized that the site saves the data. If there’s data that could be confidential, it may not be a good idea use a 3rd party website. So I created a simple hosted page to pretty print a JSON.

<script type="text/javascript" src=""></script>
<script type="text/javascript">
function onSubmit(){
	var $json_input = $( "#ta_json_input" );
	var json_out = JSON.stringify(JSON.parse($json_input.val()), null, 4);
<form id="frmJson" name="frmJson">
<h2>Pretty JSON</h2>
<textarea id="ta_json_input" rows="30" style="width:100%; overflow-x: scroll; "></textarea>
<input type="button" value="Submit" onclick="onSubmit()" style="height:30px;">

Here’s how the page looks like:


One thought on “Pretty Print JSON

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s