JSON Formatter
Pretty-print messy or minified JSON with 2-space indents.
Convert HTML to JSX and fix the common React gotchas such as class and inline styles. It is a regex first pass, not a full converter.
Your browser is preparing the tool. It runs 100% locally.
Paste HTML and the tool rewrites the differences React needs: class becomes className, for becomes htmlFor, HTML comments become JSX comments, and an inline style string becomes a camelCased style object. It is a fast first pass for moving markup into a component. It is regex-based, so it does not self-close void elements or rename every attribute, so review the result. Your browser does the work, so nothing is uploaded.
This tool takes a block of HTML and applies the most common transformations needed to use it as JSX in a React component. It handles the renames and rewrites that would otherwise cause errors or warnings when you paste raw HTML into JSX.
Use it to start turning a markup snippet (a template, an icon, a chunk of a page) into a component. It does the repetitive find-and-replace and leaves you the parts that need judgement.
The tool runs a set of regular expressions over your HTML. It renames the class attribute to className and for to htmlFor, turns HTML comments into JSX comment expressions, and converts an inline style string into a JavaScript object with camelCased property names, which is what JSX expects.
Because it works by pattern-matching rather than parsing the markup into a tree, it is fast and dependency-free. It also means it only changes the specific things its patterns target, and it cannot reason about the structure the way a full converter would.
class= → className= for= → htmlFor=
HTML comment → JSX comment in braces
inline style string → camelCased style object<div class="box" style="margin-top: 10px"><!-- hi --></div> → <div className="box" style={{marginTop: '10px'}}>{/* hi */}</div>It fixes the common gotchas, but it is a regex pass: it does not self-close void elements (a br stays unclosed, which is invalid JSX) and renames only class and for, not the dozens of other camelCase attributes. Review the result.
Your HTML never leaves your device. The conversion runs in your browser with no network request, so nothing is uploaded.
Because the work is local, you can convert proprietary templates or internal markup without it being stored or sent anywhere.
Nothing carries over between visits. Close the tab and the input and output are gone.
For the cases it targets (class, for, comments and inline styles), the conversion is reliable and saves the repetitive edits that catch people out when pasting HTML into JSX.
It does not self-close void elements. Tags like br, img and input are valid in HTML without a closing slash, but JSX requires them self-closed. The tool leaves them as they are, so you must add the slash yourself or JSX will not compile.
It renames only class and for. JSX has dozens of other attribute differences, such as onclick to onClick, tabindex to tabIndex and SVG attributes like stroke-width to strokeWidth, which this regex pass does not handle. Convert those by hand.
The style conversion is pattern-based, so an inline style whose value contains a colon (such as a url) or unusual syntax can be converted incorrectly. Check any complex inline styles in the output, and treat the result as a first pass to review.
Convert a markup snippet into JSX to drop into a React component.
Rename class and for and rewrite inline styles automatically.
Make a first pass over HTML templates moving to React.
See how HTML attributes map to their JSX equivalents.
For a thorough conversion, use a parser-based HTML-to-JSX tool or your editor's converter, then compile to catch what remains. This regex pass handles the common gotchas; finish the void elements and other attribute renames by hand.
Rewrites the common HTML-to-JSX differences (class, for, comments, inline style) with regex. It does not self-close void elements or rename every attribute, so review the output.
Pretty-print messy or minified JSON with 2-space indents.
Paste JSON and find out whether it parses.
Standard Base64 for any text, emoji included.
MD5, SHA-1 and the SHA-2 hashes of any text, as you type.
Up to 500 random version 4 UUIDs at once.
Strips comments and whitespace to put a stylesheet on one line.
Paste, run and copy. The code stays in your browser and you don't need an account.