Why convert HTML to JSX?
JSX is HTML's React dialect - almost identical, but with a few easy-to-miss differences. `class` must be `className` (because `class` is a JavaScript keyword). `for` in `<label for="x">` becomes `htmlFor`. Comments `<!-- ... -->` do not work, you need `{/* ... */}`. Inline style must be a JavaScript object: `style={{ color: 'red' }}` with camelCase keys.
Paste your HTML here (from a Figma export, an icon library, a snippet from the web) and get ready JSX to drop into a React component. The converter handles SVG attributes (`stroke-width` to `strokeWidth`), self-closing for `<br>` / `<img>` / `<input>`, boolean attributes and HTML entities.
Everything runs in your browser - the code never leaves your machine.
How to use
- Paste HTML in the left panel (a Figma fragment, an SVG icon, a piece of a page you want to refactor).
- On the right you see JSX - with attributes and styles rewritten.
- Toggle "Wrap in component" to get a ready `export default function Component() { return (...) }`.
- Switch to TypeScript mode to add a typed return value.
- Hit "Copy" and paste it into your `.tsx` file.
When this helps
Real situations where this converter saves time:
- Migrating legacy HTML to React. You have an old project with `.html` files or a Bootstrap template and you want to rewrite it as React/Next.js. Paste each section, get a working component.
- Icons from Figma / Iconify. A designer exports an SVG icon and you paste it to get a React component.
- Snippets from CodePen / StackOverflow. Someone posted a vanilla HTML solution - paste it, get JSX.
- Marketing assets. Paste a hero section or a CTA box and turn it into a component.
- Email templates. Email HTML with literal `style="..."` becomes `style={{...}}` - useful if you preview templates inside a React app.
- Refactoring. Your team moved to React and has 100 old product cards in plain HTML to migrate.
- Learning. Studying React and want to see "what would this look like in JSX" quickly.
To convert SVG to a React component (a more advanced flow, with size/color props) see SVG to React component. For CSS gradients see gradient generator.