About this tool
The HTML to JSX / React converter parses an HTML snippet with the browser's native DOMParser and re-serializes it as valid JSX, fixing everything React needs. It runs fully client-side, so the markup you paste stays on your machine. Paste any HTML — a design export, an email template, a component sketch — and get JSX you can drop straight into a React file.
The rewrite renames reserved attributes (class becomes className, for becomes htmlFor), camelCases the rest — tabindex to tabIndex, maxlength to maxLength, stroke-width to strokeWidth — while leaving data-* and aria-* attributes untouched. Void elements such as img, br, input, and hr are made self-closing (<img />), HTML comments become {/* ... */}, literal braces in text are escaped as {'{'}, and an inline style="a:b;c:d" string is converted to a style={{ a: 'b', c: 'd' }} object with camelCased CSS keys. Boolean attributes like disabled can be emitted bare or as ={true} with a toggle.
Choose fragment output — multiple root nodes are automatically wrapped in a <>...</> fragment — or full-component output, which wraps the JSX in an export default function with your chosen name and indentation (2 spaces, 4 spaces, or tabs). The result is ready to paste; because the parse uses a real DOM, malformed nesting is normalized the same way a browser would.