HTML entity for an en dash –

– / – / –

– is the HTML entity for the en dash –, U+2013 EN DASH, and – and – are its numeric references. In UTF-8 it’s E2 80 93.

Character    – U+2013 EN DASH
Named        –
Numeric      –    –
UTF-8        E2 80 93

Encoding Pages 10–12, 9:00–17:00 gives:

Pages 10–12, 9:00–17:00

What it’s for

The en dash joins the ends of a range: numbers, dates and times (1990–2026, Mon–Fri, 9:00–17:00), scores and votes (3–1), and pairs of equal terms (the Paris–Berlin train). The Chicago Manual of Style also uses it in compounds built on an open compound, such as pre–Civil War. After “from” or “between”, use words: from 10 to 12, not from 10–12.

US style uses the em dash (—) to break a sentence; British style often uses a spaced en dash – like this – for the same job.

Not a minus, not a hyphen

For negative numbers in running text, typography uses the minus sign −, U+2212, −. In data and code only the hyphen-minus parses: in JavaScript, Number('–5') and Number('−5') are both NaN, and Number('-5') is -5. Keep en dashes out of values that a program reads.

Intl.DateTimeFormat’s formatRange already writes the dash for you: in Node 22, a January 10 to 12 range in en-US comes out as Jan 10 – 12, with thin spaces (U+2009) around U+2013.

Legacy –

Pages converted from Windows-1252 often contain –. The HTML standard reads that C1 code as an en dash and reports a parse error, and this tool decodes it the same way. Write – in new markup.

In CSS, JSX and Markdown

In JSX, the entity sits between expressions like any text:

<span>{start}&ndash;{end}</span>

In braces it’s JavaScript, so write {`${start}\u2013${end}`} there; {'&ndash;'} prints the entity’s letters. In CSS it’s content: "\2013". CommonMark decodes &ndash; in Markdown text and leaves it literal in code spans; -- becomes – only with a typographer such as markdown-it’s typographer option.

Try it in the HTML Entity Encoder & Decoder

Encoded

2 characters become a reference, named where a name exists and &#x…; where one doesn’t.

Encoding always escapes &amp;, &lt;, &gt;, &quot; and &#39; — the characters that mean something to an HTML parser.

Runs in your browser. Nothing you enter is sent anywhere.