工具 指南
developer 免费 无需注册

HTML实体参考

可搜索的HTML实体参考,包含命名、数字和十六进制形式——点击即可复制。

正在加载工具…

关于此工具

浏览或搜索近500个最常用的HTML实体,按类别分组:基础、货币、数学、希腊字母、箭头、标点、拉丁扩展和符号。每个条目在其命名(&)、数字(<)和十六进制(<)形式旁显示渲染后的字符。点击任意形式即可立即复制。页面顶部的快速参考面板突出显示最常用的实体。

使用方法

  1. 1 第一步:浏览「最常用」快速参考面板,查看最常见的实体。
  2. 2 第二步:使用搜索框按实体名称、字符或描述筛选。
  3. 3 第三步:点击类别标签浏览该组中的所有实体。
  4. 4 第四步:点击任意实体形式(命名、数字或十六进制)将其复制到剪贴板。

What an HTML entity is, and why you need one

An HTML entity is a short code that stands in for a character a browser would otherwise misread or fail to display. A few characters are structural in HTML — the browser treats them as markup, not text. The clearest example is the less-than sign: write < directly in your page and the browser starts looking for a tag. To show a literal < on screen you must write the entity &lt; instead. Entities also let you type characters your keyboard can't produce — a Greek π, an em dash , a copyright ©, or an arrow — without hunting for special key combinations or pasting from another app. This reference lists hundreds of them across categories, and clicking any code copies it straight to your clipboard.

Three ways to write the same character

Most characters can be expressed three ways, and the table shows all three side by side:

FormExample (for ©)How it's built
Named&copy;A human-readable keyword between & and ;
Numeric (decimal)&#169;The character's Unicode code point in base 10
Hexadecimal&#x A9; (no space)The same code point in base 16, prefixed with x

All three render identically. The key practical difference: not every character has a named entity. The euro and copyright signs do, but a Bitcoin sign, an Indian rupee, or most emoji-style symbols do not — for those, this reference shows a dash in the "Named" column and you must use the numeric or hex form. Numeric and hexadecimal forms always work because every character in Unicode has a code point.

The five entities you actually must memorise

Out of the hundreds listed, only a handful are non-negotiable when you generate HTML by hand or in code. Whenever you insert untrusted or user-supplied text into a page, escape these to prevent broken layout and cross-site scripting:

  • &amp; for the ampersand & — escape it first, or it can swallow the entities that follow it.
  • &lt; and &gt; for < and > — these stop text from being parsed as tags.
  • &quot; for the double quote " — needed inside double-quoted attribute values.
  • &#39; for the apostrophe ' — needed inside single-quoted attributes. (The named form &apos; works in HTML5 but not in older HTML 4, so the numeric form is the safer choice.)

A worked example: a "less-than or equal" comparison

Suppose you're documenting a rule that reads "price <= 100". Typed raw into HTML, the < would begin a phantom tag and the rest of the line could disappear. Search this reference for "less" and you'll find two relevant rows: &lt; for the plain less-than sign, and &le; (numeric &#8804;) for the proper "less-than or equal to" symbol ≤. Writing price &le; 100 renders as the clean, correct price ≤ 100 — both safer and more professional than the ASCII <=.

The non-breaking space, the most misused entity

&nbsp; renders as a space, but it has a special property: the browser will never break a line at it, and it won't collapse the way ordinary repeated spaces do. Use it to keep a number with its unit (10&nbsp;kg) or a name with a title together on one line. The common mistake is reaching for a string of &nbsp;&nbsp;&nbsp; to create indentation or layout gaps — that's fragile and inaccessible. Use CSS margins and padding for spacing; reserve &nbsp; for genuinely non-breaking text.

Search tips and practical use

  • Search by description, name, or the character itself. Type "arrow" to see the whole arrow family, "copyright" to find ©, or paste the symbol directly to discover its codes.
  • Browse by category when you're exploring. The tabs group entities into Basic, Currency, Mathematical, Greek, Arrows, Punctuation, Latin Extended, and Symbols — handy when you know roughly what you want but not its name.
  • Prefer typographic punctuation. Real curly quotes (&ldquo; “ &rdquo; ”) and proper dashes (&mdash; —, &ndash; –) look far more polished than straight quotes and hyphens.
  • Modern pages are UTF-8. If your document declares a UTF-8 charset, you can often paste the character directly. Entities remain the bullet-proof choice for the five structural characters and for email or legacy systems where encoding is uncertain.

常见问题

{# Alpine.js — self-hosted. (The previous jsdelivr CDN tag had a stale SRI integrity hash, so the browser refused to run it and window.Alpine was never defined — silently breaking every FAQ accordion and Alpine tool.) #}