Skip to content

HTML to JSX Converter

JSX looks like HTML, but it isn't. React reuses JavaScript's variable-naming rules, which means 'class' becomes 'className', 'for' becomes 'htmlFor', and event handlers like 'onclick' become 'onClick'. Inline styles that were strings become JavaScript objects with camelCase property names. Void elements must self-close. This tool handles all of that in one paste-and-copy operation.

What Gets Converted

Attribute renames — class → className, for → htmlFor, tabindex → tabIndex, readonly → readOnly, maxlength → maxLength, and 30+ other renames. Event handlers — onclick → onClick, onmouseover → onMouseOver, onchange → onChange (all events camelCased). Void element self-closing — <img>, <input>, <br>, <hr> get proper <img /> syntax. Style strings to objects — 'color: red; font-size: 16px' becomes {{color: 'red', fontSize: '16px'}}. HTML comments — converted to JSX-compatible {/* */} syntax. Boolean attributes — checked, disabled, required become explicit true assignments.

📖
Deep Dive: The Complete HTML to JSX Guide
The full attribute rename list, inline-style object conversion, boolean attributes, edge cases with SVG and scripts, and what the converter leaves for you to wire up.

Frequently Asked Questions

Can I paste an entire web page?+
You can, but inline scripts and event handler strings won't work as-is. JSX expects JS functions passed as values. Paste HTML fragments or bodies — then manually wire up event handlers to real functions.
What about SVG?+
SVG markup generally works in JSX. Attribute renames like xmlns:xlink → xmlnsXlink may need manual adjustment for complex SVGs with namespaces. Simple SVG icons work without any extra steps.
Does it privacy-check my HTML?+
The entire converter runs in your browser. Your HTML is never sent to any server. If your markup contains sensitive tokens or user data, the output copy will contain them too — clean before committing.

Built by Derek Giordano · Part of Ultimate Design Tools

Privacy Policy · Terms of Service