⚛ HTML to JSX Converter
Convert HTML to JSX/TSX for React. Runs entirely in your browser.
Last updated: November 8, 2026 · By the BoltQuickTools team
Paste HTML into a React component without the errors
HTML dropped into a React component breaks on class, unclosed <br> tags and string styles. When you are moving markup from a template or a design export into React, this page does the bulk of the renaming. It is a text transformation in the page, and the tool's code sends nothing anywhere.
Running a conversion
- Paste into Input HTML. JSX Output updates shortly after you type or paste, or press Convert.
- Untick Preserve comments to delete comments rather than converting them.
- Copy Output copies the result, Sample HTML loads a longer example and Clear resets both boxes.
TypeScript mode only adds two comment lines to the top of the output. It does not add types or change the JSX, and you will need to delete those lines if you paste the result inside a component's return statement.
A form fragment, before and after
<label for="e" class="f">Email</label>
<input id="e" type="email" value="[email protected]" tabindex="1" readonly>
<br>
<!-- note -->
<td colspan="2" style="color: red; font-size: 14px; margin: 0">x</td>
<button disabled onclick="save()">Go</button>
becomes:
<label htmlFor="e" className="f">Email</label>
<input id="e" type="email" defaultValue="[email protected]" tabIndex="1" readOnly />
<br />
{/* note */}
<td colSpan="2" style={{color: 'red', fontSize: '14px', margin: 0}}>x</td>
<button disabled onClick={() => { save() }}>Go</button>
Handlers are wrapped as written in an arrow function. save still needs to exist in your component's scope.
What you still have to fix by hand
The page uses regular expressions and has no HTML parser, and the status message says success regardless. Read through the output, looking for these cases:
- Event names are only capitalised on the first letter.
onmouseoverbecomesonMouseoverandonkeydownbecomesonKeydown. React expectsonMouseOverandonKeyDown, so these handlers need correcting. - The rename list is short:
class,for,tabindex,readonly,maxlength,colspan,rowspan,cellpadding,cellspacing,enctype,crossorigin,autocomplete,autofocusandcontenteditable. Others such assrcset,novalidate,autoplay,accept-charset,stroke-widthandframeborderare left unchanged. valuebecomesdefaultValueon every element, which is wrong foroption,buttonandli.- Tags with a hyphen in the name, such as
<x-card class="a">, are skipped entirely. - A
>inside an attribute value breaks that tag. A double quote inside a single-quoted value is output without escaping. - Literal
{and}in text are not escaped.scriptandstylebodies are not escaped, and CSS braces inside them will not compile. - Styles are split at every semicolon, so a
data:URL inbackgroundis cut in half.-webkit-transformbecomeswebkitTransformwhere React expectsWebkitTransform, and--gapbecomesGap. - A value with no unit becomes a number:
margin:10becomesmargin: 10, which React treats as pixels. - Sibling elements are not wrapped, so multiple top-level tags need a parent or fragment.
Reader questions
Why did value turn into defaultValue?
Mapping to defaultValue and defaultChecked creates an uncontrolled input that users can edit. For a controlled field, rename it to value and add an onChange handler.
Does the conversion count mean it found problems?
The "conversions" figure is a rough count of matching patterns in the input and is not a measure of correctness.
Can I tidy the markup first?
Formatting helps you review the result, so run it through the HTML beautifier first if it is minified. To audit which attributes a snippet uses before converting, try the HTML attribute extractor. For typing API data used by the component, the JSON to TypeScript converter helps.