<cite> & <q> Tags in HTML

Quick facts

CategoryFlow content, phrasing content, palpable content
Content modelPhrasing content
Tag omissionNeither the start nor the end tag can be omitted
Permitted parentsAny element that accepts phrasing content
DOM interfaceHTMLElement (<cite>), HTMLQuoteElement (<q>)

Syntax

<p>My favorite book is <cite>The Hobbit</cite>.</p> <p>She said <q cite="https://example.com/talk">keep it simple</q>.</p>

Live example

Edit the code below and watch the preview update instantly.

index.html
Preview

Attributes

<q>

AttributeDescription
citeA URL pointing to the source of the quotation. It is not displayed; it’s metadata for machines.

<cite>

AttributeDescription
—Only the global attributes apply.

Common examples

Titles of creative works

<cite> marks the title of a book, film, song, article or website.

<p>My favorite book is <cite>The Hobbit</cite>, and I just watched <cite>Spirited Away</cite>.</p>

A short quote inside a sentence

<q> adds the quotation marks for you.

<p>As the saying goes, <q>practice makes perfect</q>.</p>

A quote with its source

The cite attribute on q stores the source URL; the <cite> element shows the title.

<p>The spec says <q cite="https://html.spec.whatwg.org/">the q element represents some phrasing content quoted from another source</q> (<cite>HTML Living Standard</cite>).</p>

Quotes in other languages

Set lang and the browser uses the right quotation marks for that language.

<p lang="fr">Il a dit <q>bonjour</q>.</p> <p lang="de">Er sagte <q>hallo</q>.</p>

<q> vs typing quotation marks

You can just type quotation marks around a quote, and that’s perfectly valid. <q> adds two things: it marks the text as a quotation for software, and the browser draws the right quotation marks for the page’s language, including nested quotes.

Use q when you want consistent, language-aware quote marks or want to record the source with cite. Never do both — typed marks plus <q> gives you double quotation marks.

<q>Typed “marks”
Quote marksAdded automaticallyYou type them
Language-awareYesNo
Source URLcite attributeNone

Common mistakes to avoid

  • Putting a person’s name in cite. The element is for titles of works; author names can stay as plain text.
  • Typing quote marks inside q. The browser already adds them, so you end up with two pairs.
  • Using q for long quotations. Quotes that take up a paragraph belong in <blockquote>.
  • Using cite just for italics. Style with CSS if it isn’t a title.

Accessibility & SEO tips

  • Credit sources with the title and a link — it builds trust with readers and shows search engines your content is well researched.
  • Set the lang attribute on your page so q uses the right quotation marks automatically.
  • Screen readers usually don’t announce q, but they do read the quotation marks the browser adds in most cases.
  • Mark up titles of works consistently across your site with cite, so readers learn to recognise titles at a glance.

Browser support

Supported in every browser, including Chrome, Edge, Firefox, Safari and their mobile versions — it has been part of HTML since the very first versions.

Related tags

Frequently asked questions

When should I use <q> instead of <blockquote>?
Use <q> for a short quote that sits inside a sentence. Use <blockquote> for a longer quotation that forms its own block, usually one or more paragraphs.
Should I put a person's name in <cite>?
The HTML spec says <cite> is for the title of a work, not the name of a person. Put the author's name in plain text or a <span> next to the title.
Why does <q> add quotation marks automatically?
Browsers insert language-appropriate quote marks with CSS. Don't type your own quote marks inside <q>, or they will appear twice.
Why is the text inside <cite> italic?
Book and film titles are traditionally written in italics, so browsers style cite that way. Change it with cite { font-style: normal; }.
How do I change the quotation marks of <q>?
Use the CSS quotes property, for example q { quotes: "«" "»"; }, or set the right lang attribute and let the browser choose.
Is the cite attribute shown on the page?
No. It stores the source URL for software only. Add a visible link if you want readers to see the source.
Can <q> be nested?
Yes. A quote inside a quote can use another <q>, and the browser switches to the right inner marks, such as single quotes in English.
Should a website name go in <cite>?
Yes, the name of a website or article counts as the title of a work, for example <cite>MDN Web Docs</cite>.