Formats JavaScript code using Prettier — the industry-standard JS/TS formatter. Corrects indentation, adds missing semicolons, normalises quote styles, sorts object keys, and ensures consistent spacing. Supports modern JavaScript including ES2024 syntax, arrow functions, async/await, destructuring, and optional chaining.
Paste your JavaScript and get properly formatted output — configure indent size and quote style. For formatting CSS files, use the CSS Formatter & Minifier.
Format JS
Input
const fn=()=>{return{a:1,b:2}}Output
const fn = () => {
return { a: 1, b: 2 };
};Format messy CSS or minify it for production.
Beautify, minify, and validate JSON with syntax highlighting.
Minify HTML by removing whitespace, comments, and optional attributes.
Escape special characters for JSON strings, or unescape JSON string values.
Compare two blocks of text and highlight the differences.
Test regular expressions against sample text with live match highlighting.