Skip to content
ToolPlankDEV
Developer Tools
100% In-Browser Execution

Updated:

JSX to HTML Converter

Paste JSX or a React component and get plain HTML. This jsx to html converter renames className and htmlFor, turns style objects into style strings, and marks every dynamic value with a placeholder and its line number. Nothing is uploaded.

Options:

JSX

Input
0 chars · 0 lines

HTML

Ready
Processing in browser...
0 chars · 0 linesUpdates as you type

What changed

Dynamic values, removed handlers and kept components are listed here.

Processed on your device. Your text is not sent to our servers.

More free tools you may need next.

Quick Guide

How to use JSX to HTML

Simple step-by-step instructions to get the exact output you need.

  1. 01

    Paste JSX or a component

    Paste JSX such as <div className="box">...</div>, or a whole React component. The tool finds the JSX the component returns. Example loads a small Card component.

  2. 02

    Choose how dynamic values are handled

    Values like {title} cannot be known without running the code. Keep them as {{ placeholder }} text, or remove them. Turn comments on or off and set the indent.

  3. 03

    Read the list of dynamic values

    The panel under the result names each dynamic value, with its line number, so you know what to fill in. It also lists removed event handlers and components it kept.

  4. 04

    Copy the HTML

    Press Copy to put the HTML on your clipboard. Wrap in a full page adds a doctype, head and body so the file opens on its own.

How to convert JSX to HTML

JSX is JavaScript that looks like HTML, so a browser cannot read it directly. To convert jsx to html, the tool reads the JSX, renames the attributes back to their HTML names, writes style objects as style strings and prints plain markup. Anything that depends on running the code is marked instead of guessed.

The built-in example is a Card component with a style object, a comment, a label, a checkbox and a button. The result is:

HTML
<div class="card" style="padding: 16px; background-color: white">
  <!-- header -->
  <h2 class="card__title">{{title}}</h2>
  <p>Read the <a href="/docs" target="_blank" rel="noreferrer">docs</a> first.</p>
  <label for="agree">Agree</label>
  <input id="agree" type="checkbox" checked disabled tabindex="0">
  <button class="{{items.length ? &quot;on&quot; : &quot;off&quot;}}">Save</button>
</div>

The status line reports 5 attributes renamed and 2 dynamic values, and the panel lists them as Line 5 and Line 11.

What changes when you convert JSX to HTML

  • Attribute names. className becomes class, htmlFor becomes for, and tabIndex, colSpan, maxLength and similar names return to lowercase.
  • Style objects. { padding: 16, backgroundColor: "white" } becomes padding: 16px; background-color: white. Numbers get px, except unitless properties such as opacity and z-index.
  • Default props. defaultValue becomes value and defaultChecked becomes checked.
  • Boolean attributes. disabled stays as a bare attribute, and disabled={false} is left out.
  • Self-closing tags. <br /> becomes <br>, and <div /> becomes <div></div>, because HTML does not allow a self-closed div.
  • Comments. A JSX comment in braces becomes an HTML comment.
  • SVG. Names such as strokeWidth go back to stroke-width. For a whole SVG in JSX, JSX to SVG builds a standalone file.

Dynamic values, components and handlers

HTML cannot hold JavaScript expressions, so the converter handles each kind of dynamic part openly:

  • Expressions such as {title}, {items.map(...)} or className={cls} become {{ title }}-style placeholders. Turn the option off to remove them. Each one is listed with the line it came from.
  • Literal expressions, such as {"text"}, {42} and template strings without variables, are written as plain text. {null}, {false} and {undefined} disappear, as they do in React.
  • Event handlers such as onClick are removed and listed, because HTML has no equivalent that carries a function.
  • Components with a capital letter, such as <Card>, are kept as written and listed. The tool cannot know what they render.
  • Props spreads, {...props}, are removed. Conditional parts such as {open && <p />} are marked as dynamic, not expanded.

JSX from a whole file

You can paste an entire component file. The tool skips imports, hooks, types and strings, and starts at the first piece of JSX, such as the one after return ( or after =>. TypeScript syntax like useState<string> is not mistaken for a tag. If the file holds more than one component, only the first JSX is converted, and a note says how many more it found.

To go the other way, HTML to JSX converts markup into JSX with renamed attributes and style objects. HTML Decoder and Remove HTML Tags help when the HTML you end up with needs entities decoded or tags stripped.

Can a React component be rendered to real HTML?

Not here. This tool converts the markup in the source. It does not run your code, so it cannot call hooks, read props, run conditions or expand components. A page rendered by React at run time can be saved with a browser, or generated with a server-side rendering function such as renderToString in your project.

Limits

  • JSX inside an attribute value, as in icon={<Icon />}, is not read and the tool says so.
  • Whitespace follows JSX rules: lines of text are joined with one space, and spaces at the start and end of a line are dropped.
  • Only the first JSX in a file is converted.

Your code is converted in your browser. It is not uploaded or stored. See the Privacy Policy for details.

Frequently Asked Questions

Technical Q&A for JSX to HTML

Common questions about edge cases, character encoding, and privacy guarantees.

Paste your JSX or component into the left box. The HTML appears on the right, with className turned into class and style objects into style strings. Press Copy to use it.

They cannot be known without running the code, so each one becomes a {{ placeholder }} and is listed with its line number. You can also choose to remove them.

Yes. Paste the file and the tool starts at the first JSX, usually the one after return. Imports, hooks and types are skipped.

No. It converts the markup it can read and does not run your code. For real rendering, use renderToString in your project or save the page from a browser.

Each key becomes a CSS property and each number gets px, except unitless properties such as opacity and z-index. So padding: 16 becomes padding: 16px.

They are removed and listed, because HTML has no way to carry a JavaScript function in an attribute the way JSX does.

They are kept as written, since the tool cannot know what they render, and they are listed so you can replace them with real markup.

Yes. Types, generics and hooks are skipped, and the JSX in the return is converted.

Yes. Turn on Wrap in a full page to add a doctype, html, head and body around the result.

No. The conversion runs in your browser and nothing is sent to a server.