HTML to JSX converter

Paste HTML and get a React component in TSX. No install needed.

Converted successfully

Source HTML

HTML · UTF-8Prettier

Output JSX

export default function ProductCard() {
  return (
    <article className="product-card">
      <h1 style={{ color: '#c2410c' }}>Cove Lamp</h1>
      <label htmlFor="qty">Qty</label>
      <img alt="Cove lamp" />
    </article>
  )
}
TSX · UTF-8Prettier

Chrome extension · Any website · Tailwind or CSS

Copy any element from a web page as a React component

Hover over a card, a header or a whole section, click it, and get clean TSX in a new tab. No pasting into online tools, no manual cleanup.

  • No account required
  • Any website
  • TSX output by default
Cove Table Lamp — Alder & Co.
alderandco.com/products/cove-table-lamp

COMPLIMENTARY DELIVERY ON ORDERS OVER $100

SHOPAlder & Co.BAG (0)
Product photo of the Cove table lamp on the sample shop page
<article>

The Hearth Collection

Cove Table Lamp

$148

A softly sculpted ceramic base and gathered linen shade bring a calm, warm glow to bedside tables and reading corners.

SandRustOlive

Add to cart — $148

Free standard delivery · Easy 30-day returns

ProductCard.tsx

Copy
export function ProductCard() {
  return (
    <article className="rounded-xl border bg-white p-7">
      <p className="text-xs font-bold text-orange-700">
        The Hearth Collection
      </p>
      <h1 className="font-serif text-4xl">Cove Table Lamp</h1>
      <p className="text-lg">$148</p>
      <button className="w-full rounded-lg bg-orange-700 py-3">
        Add to cart — $148
      </button>
    </article>
  );
}
TSX · UTF-8Prettier

Convert code in both directions

Already have markup in your clipboard? Paste it into the html to jsx converter online, right on this page: paste markup, get a React component, copy it back. A quick html to react component step for templates and snippets from docs.

It works the other way too. Paste a component and the jsx to html converter returns plain markup with class and style attributes restored. Convert jsx to html for an email template or a static page, or use it as a react to html converter when a design has to leave the React app.

How the HTML to JSX converter works

  1. 1

    Pick an element or the whole page

    Open the popup and choose what to grab: hover over the page and click a single element with the picker, or press one button to take the whole page as one component.

    Cove Table Lamp — Alder & Co.
    alderandco.com/products/cove-table-lamp

    COMPLIMENTARY DELIVERY ON ORDERS OVER $100

    SHOPAlder & Co.BAG (0)
    Product photo of the Cove table lamp on the sample shop page
    <article>

    The Hearth Collection

    Cove Table Lamp

    $148

    A softly sculpted ceramic base and gathered linen shade bring a calm, warm glow to bedside tables and reading corners.

    SandRustOlive

    Add to cart — $148

    Free standard delivery · Easy 30-day returns

    HTML to JSXTurn page markup into clean JSX
    Convert codeSelect from pageSelect whole page
    ThemeLightDarkSystem
  2. 2

    The markup is cleaned

    The extension takes the markup and cleans it: scripts, inline event handlers and tracking attributes are removed, every image and link URL becomes absolute, and every attribute gets the React spelling, so class becomes className and style strings become objects.

    HTMLREACT ATTRIBUTES
    class=className=
    style="…"style={{…}}
    onclickREMOVED
    data-trackingREMOVED
  3. 3

    Real styles are extracted

    The styles that actually apply to the element are extracted as computed values. Most html to react converter tools stop at the markup. Html to jsx does not.

    Computed styles

    Copy
    .product-card {
      padding: 28px;
      border-radius: 12px;
      background: #fff;
      border: 1px solid #ddd8d1;
    }
    CSS · UTF-8Prettier
  4. 4

    Styles become Tailwind classes

    The css to jsx step maps those styles to Tailwind utility classes: existing Tailwind classes are kept as they are, plain CSS and CSS-in-JS are turned into utilities, and the css to react conversion runs on real computed values, so colors and spacing match the screen.

    TailwindCSSInline styles
    rounded-xlborderborder-stone-300bg-whitep-7text-orange-700font-seriftext-4xlw-fullpy-3
  5. 5

    Get a ready TSX file

    The result opens in the workspace as a ready TSX file: check it against the original markup, adjust the code by hand if you want, then copy it into your project or download it.

    HTML to JSX — Cove Table Lamp
    Conversion workspaceDownload as ZIP

    Source HTML

    Copy
    <article class="product-card">
      <h1 style="color: #c2410c">Cove Lamp</h1>
      <label for="qty">Qty</label>
      <img alt="Cove lamp" />
    </article>
    
    HTML · UTF-8Prettier

    ProductCard.tsx

    Copy
    export default function ProductCard() {
      return (
        <article className="product-card">
          <h1 style={{ color: '#c2410c' }}>Cove Lamp</h1>
          <label htmlFor="qty">Qty</label>
          <img alt="Cove lamp" />
        </article>
      )
    }
    
    TSX · UTF-8Prettier

What you get from the HTML to JSX converter

ProductCard.tsx

Copy
export default function ProductCard() {
  return (
    <article className="product-card">
      <h1 style={{ color: '#c2410c' }}>Cove Lamp</h1>
      <label htmlFor="qty">Qty</label>
      <img alt="Cove lamp" />
    </article>
  )
}
TSX · UTF-8Prettier

A named export function in a .tsx file, ready to drop into your project.

One pass works as a jsx converter and a tsx converter, with Prettier formatting out of the box.

  • TSX
  • Named export
  • Prettier

SVG to React without a separate tool

Inline icons come through untouched: attribute names are mapped the way React expects, so svg to jsx and svg to tsx work in the same pass. Select a logo, get a component.

<svg>Sample arrow logo selected on a page for conversion to a React SVG component

ArrowLogo.tsx

Copy
export function ArrowLogo() {
  return (
    <svg viewBox="0 0 112 56" fill="none" strokeWidth={1.5>
      <path
        fillRule="evenodd"
        clipRule="evenodd"
        fill="currentColor"
        d="M0 0h36l28 28H0V14h36L50 28 36 42H0v14h36l28-28"
      />
    </svg>
  );
}
TSX · UTF-8Prettier

Workspace built for React tools

  • Side by side panelsHTML and TSX, side by side.
  • One click copyCopy code to your clipboard.
  • Download as a fileExport a TSX file or ZIP.
  • Live previewSee the rendered component.

Side by side source and code panels

HTML to JSX — Cove Table Lamp

Source HTML

Copy
<article class="product-card">
  <h1 style="color: #c2410c">Cove Lamp</h1>
  <label for="qty">Qty</label>
  <img alt="Cove lamp" />
</article>
HTML · UTF-8Prettier

ProductCard.tsx

Copy
export default function ProductCard() {
  return (
    <article className="product-card">
      <h1 style={{ color: '#c2410c' }}>Cove Lamp</h1>
      <label htmlFor="qty">Qty</label>
      <img alt="Cove lamp" />
    </article>
  )
}
TSX · UTF-8Prettier

One click copy for each panel

Source HTMLCopy
React componentCopy

Download the result as a file

ProductCard.tsx· 1.2 KBCopyDownload

Download as ZIP

Live preview in a sandboxed frame

export default function ProductCard() {
  return (
    <article className="product-card">
      <h1 style={{ color: '#c2410c' }}>Cove Lamp</h1>
      <label htmlFor="qty">Qty</label>
      <img alt="Cove lamp" />
    </article>
  )
}

Cove Table Lamp

$148

Add to cart — $148

Code editor & rendered previewProductCard.tsx · TSX source

ProductCard.tsx

Copy
export default function ProductCard() {
  return (
    <article className="product-card">
      <h1 style={{ color: '#c2410c' }}>Cove Lamp</h1>
      <label htmlFor="qty">Qty</label>
      <img alt="Cove lamp" />
    </article>
  )
}
TSX · UTF-8Prettier

The Hearth Collection

Cove Table Lamp

$148

A softly sculpted ceramic base and gathered linen shade bring a calm, warm glow to bedside tables and reading corners.

SandRustOlive

Add to cart — $148

Free standard delivery · Easy 30-day returns

Rendered successfully · Sandboxed preview

It is a react component builder that starts from a page you already like, and it sits next to the react developer tools you already use.

Who the HTML to JSX tool is for

Frontend developers

Frontend developers who rebuild designs in React and want markup and styles in one step.

Teams moving to React

Teams moving from plain html to reactjs and tired of retyping templates by hand.

Anyone extracting code from websites

Anyone who needs to extract html from website pages as code, not as a screenshot.

From production to localhost

Copy html from website pages in production, on staging or on localhost: if a page opens in your browser, it is ready for the html to jsx conversion. No account or sign up is required.

Conversion runs on our server.

  • Production
  • Staging
  • Localhost

Why not a regular React component generator

A react code generator from a text prompt guesses what you want. This extension copies what already exists, so when you need the layout of a reference site, you get its exact structure, styles and spacing.

Starts from

Layout

Styles

Prompt-based generator

a text prompt

guessed

approximate

HTML to JSX

a page you already like

exact structure

real computed values

Frequently asked questions

Pick an element or the whole page, click, copy. The whole conversion takes seconds.

Turn any element into a component

HTML to JSX is a react chrome extension that works on any site with no setup, so a single click turns any element into a component. Install the html to jsx chrome extension and run your first conversion on the page you are looking at right now.

Add to Chrome
Available in the Chrome Web StoreOFFICIAL BADGE PLACEHOLDER