# JavaScript XML (JSX)

> HTML-like tags written inside JavaScript. A build step turns them into code.

**Field:** Software Development  
**Category:** Web Development  
**Also known as:** JSX, TSX, React JSX

## Think of it like

Think of it like a recipe card with pictures. It looks like the dish, but it is still a set of steps.

## Definition

JSX lets you write HTML-like tags inside JavaScript. React made it popular, and some other tools use it too. A build step turns each tag into a plain JavaScript call. Curly braces let you drop in JavaScript values, like {name}. Some names change, so class becomes className. In TypeScript files the same idea is called TSX.

## Example

Jack writes <h1>Hi {name}</h1> in a React file. When name is Emma, the page shows Hi Emma.

## Example code

```jsx
function Greeting({ name }) {
  return <h1 className="title">Hi {name}</h1>;
}
```

A component that returns JSX. The curly braces hold a JavaScript value.

## Why it matters

React and many other tools use it to describe what each part of the screen looks like. It keeps the look and the logic side by side.

## Common mistake

Thinking JSX is HTML. It is JavaScript in disguise, so class is className and every tag must close.

## Three principles

- **Looks like HTML.** But it lives inside JavaScript.
- **Curly braces.** They drop JavaScript values into the tags.
- **Needs a build step.** Browsers cannot read it as it is.

## Related terms

- [React](https://learn.benibix.com/term/development/react)
- [UI Component](https://learn.benibix.com/term/development/component)
- [JavaScript](https://learn.benibix.com/term/development/javascript)
- [Transpiler](https://learn.benibix.com/term/development/transpiler)
- [Props](https://learn.benibix.com/term/development/props)

## Told apart from

- [JSX vs HTML](https://learn.benibix.com/compare/jsx-vs-html): People think JSX is HTML, and it is not. JSX only looks like HTML. It lives inside JavaScript, and a build step turns each tag into a function call. That is why it says className, not class, and why every tag must close.

![Three boxes in a row. What you write: <h1 className="title">Hi {name}</h1>, with notes saying className, not class, and curly braces hold JavaScript. An arrow to what runs: a jsx function call with "h1" and the parts, marked plain function calls a browser can run. An arrow to what you see: the heading Hi Emma on the page.](https://learn.benibix.com/diagrams/dev-jsx.svg)

---

Source: https://learn.benibix.com/term/development/jsx
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
