Skip to content
Toolden

TOOLDENDEVELOPERON-DEVICE

HTML to JSX Converter: React Ready

Convert HTML to JSX for React components. All processing happens in your browser, nothing is sent to a server.

Paste HTML to convert
JSX will appear here instantly.

Try Load sample to see class to className, for to htmlFor and onclick to onClick.

Converts class to className, for to htmlFor, handlers to camelCase and comments to {/* */} in your browser.

HOW TO USE

  1. 1Paste your HTML in the input. JSX appears instantly in the output as you type.
  2. 2class becomes className, for becomes htmlFor and inline handlers become camelCase.
  3. 3Load the sample to see a typical conversion at work.
  4. 4Copy the output and paste it straight into your React component.

EXAMPLE

INPUT

<label for="email" class="field" onclick="focusEmail()">Email</label>

OUTPUT

<label htmlFor="email" className="field" onClick={focusEmail()}>Email</label>

FAQ

Which attributes are converted?
Class to className, for to htmlFor, event handlers like onclick to onClick, style strings to objects, and other React specific names such as tabindex to tabIndex.
Does it convert as I type?
Yes, the JSX pane updates instantly with every keystroke. There is no convert button to press.
Is my HTML uploaded anywhere?
No. Conversion happens entirely in your browser.
Do comments survive the conversion?
Yes, HTML comments are kept and converted to JSX comment syntax.

RELATED TOOLS