← Back to Developer Tools

Code Beautifier

Instantly format and beautify your code for better readability. All processing is done locally.

Input Code
Formatted Output
const input = document.getElementById('input').value; const lang = document.getElementById('lang').value; let output = ''; const opts = { indent_size: 2, space_in_empty_paren: true }; if (lang === 'js') { output = js_beautify(input, opts); } else if (lang === 'css') { output = css_beautify(input, opts); } else if (lang === 'html') { output = html_beautify(input, opts); } document.getElementById('output').value = output; } function copy() { navigator.clipboard.writeText(document.getElementById('output').value); }