Text-formatting summary
Stay organized with collections
Save and categorize content based on your preferences.
The page summarizes, and provides a quick reference for, many of the general text-formatting
conventions covered elsewhere in the style guide. For more information, see
Visual formatting.
- Bold
- Use bold formatting,
<b>
or **
, only for
UI elements and
run-in headings, including at the beginning of
notices.
- Although a double underscore,
__
, can also indicate bold styling in Markdown, it
can be difficult to distinguish in a text editor. It's best to use the double asterisk for bold in
Markdown.
- Italic
- In general, use italics sparingly.
- When you're discussing or introducing terms, such as when defining terms or using
words as words, use italics formatting,
<i>
or _
. For more
information, see
Use italics to discuss terms.
- When you need to add emphasis to indicate importance, use italics, not bold or underline. But
usually, your words can carry the emphasis without adding italics. To indicate
semantic emphasis in HTML, use the
em
element,
which renders as italics in most contexts. To indicate emphasis in Markdown, use underscores
(_
), which render as italics; you can't do semantic tagging in Markdown.
- Although an asterisk,
*
, can also indicate italics in Markdown, we recommend
underscores to make it easier for humans to distinguish italics from bold in the Markdown file.
- Italicize titles of books, movies, web series, and other full-length works, unless they're part
of a link. For more information, see Cross-references and linking.
- Italicize mathematical variables and version variables. For example, x + y = 3,
version 1.4.x.
- Underline
- Reserve underlining for link text. For more information, see
Style link text.
- Code font
- Use
<code>
in HTML or `
in Markdown to apply a monospace font
and other styling to code in text, inline code, and user
input.
- Use code blocks,
<pre>
or ```
, for
code samples or other blocks of code.
- Do not override or modify font styles inline.
- Use code font to mark up code, such as filenames, class names, method names, HTTP status codes,
console output, and placeholders. For more information, see
Some specific items to put
in code font.
- Capitalization
- Use American English style for
general capitalization.
- Use sentence case in all headings,
titles, and navigation.
- Use all-capitals for placeholders.
- Quotation marks
- In general, use American English style when punctuating
quotations.
- For titles of shorter works—such as articles or episodes in a web series—put titles in quotation marks, unless
they're part of a link.
- Font type, size, and color
- Do not override global styles for font type, size, or
color.
- Use semantic HTML or Markdown to
control the style of text on a page—for example, code tags in HTML (
<code>
)
or backticks in Markdown (`
)—instead of manually styling text with a monospace
font.
- Other punctuation conventions
- Don't use ampersands (&) as conjunctions or
shorthand for and. Use and instead. That includes headings and navigation.
Exception: It's okay to use & in cases where you need to refer to a UI
element or the name of a menu that uses &.
- Put quotation marks and end punctuation outside of link text. For more information, see
the Punctuation around link text
and Quotation marks and italics
sections of the "Cross-references and linking" page.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-22 UTC.
[null,null,["Last updated 2025-05-22 UTC."],[[["\u003cp\u003eThis page provides a summary of basic text formatting rules, including guidance on bold, italics, code font, capitalization, and quotation marks.\u003c/p\u003e\n"],["\u003cp\u003eFor detailed information and specific examples, refer to the linked resources within each section for deeper understanding.\u003c/p\u003e\n"],["\u003cp\u003eAvoid using underlines, overriding font styles, and using ampersands as conjunctions, ensuring content adheres to established guidelines.\u003c/p\u003e\n"],["\u003cp\u003eWhen working with code, filenames, class names, and similar elements should be formatted using code font for clarity.\u003c/p\u003e\n"],["\u003cp\u003eFollow American English conventions for capitalization and punctuation, with exceptions noted for UI elements and specific contexts.\u003c/p\u003e\n"]]],["Use bold for UI elements and notices, with `\u003cb\u003e` or `**`. Italicize words for emphasis, term definitions, titles of full-length works, mathematical variables, or version variables; use `\u003ci\u003e` or `_`. Underline only link text. Use `\u003ccode\u003e` or `` for code, filenames, and user input. Employ code blocks with `\u003cpre\u003e` or`` for code samples. Capitalize using American English, sentence case for headings, and all-caps for placeholders. Use quotation marks for shorter works. Avoid ampersands as conjunctions, except when referring to UI elements.\n"],null,["# Text-formatting summary\n\nThe page summarizes, and provides a quick reference for, many of the general text-formatting\nconventions covered elsewhere in the style guide. For more information, see\n[Visual formatting](/style/semantic-tagging#visual-formatting).\n\nBold\n: Use bold formatting, `\u003cb\u003e` or `**`, only for\n [UI elements](/style/ui-elements#formatting) and\n [run-in headings](/style/lists#types-of-lists), including at the beginning of\n [notices](/style/notices).\n: Although a double underscore, `__`, can also indicate bold styling in Markdown, it\n can be difficult to distinguish in a text editor. It's best to use the double asterisk for bold in\n Markdown.\n\nItalic\n: In general, use italics sparingly.\n: When you're discussing or introducing terms, such as when defining terms or using\n *words as words* , use italics formatting, `\u003ci\u003e` or `_`. For more\n information, see\n [Use italics to discuss terms](/style/italics-terms).\n: When you need to add emphasis to indicate importance, use italics, not bold or underline. But\n usually, your words can carry the emphasis without adding italics. To indicate\n [semantic emphasis](/style/semantic-tagging) in HTML, use the `em` element,\n which renders as italics in most contexts. To indicate emphasis in Markdown, use underscores\n (`_`), which render as italics; you can't do semantic tagging in Markdown.\n: Although an asterisk, `*`, can also indicate italics in Markdown, we recommend\n underscores to make it easier for humans to distinguish italics from bold in the Markdown file.\n: Italicize titles of books, movies, web series, and other full-length works, unless they're part\n of a link. For more information, see [Cross-references and linking](/style/cross-references).\n: Italicize mathematical variables and version variables. For example, *x* + *y* = 3,\n version 1.4.*x*.\n\nUnderline\n: Reserve underlining for link text. For more information, see\n [Style link text](https://developers.google.com/style/cross-references#style-link-text).\n\nCode font\n: Use `\u003ccode\u003e` in HTML or ````` in Markdown to apply a monospace font\n and other styling to [code in text](/style/code-in-text), inline code, and user\n input.\n: Use code blocks, `\u003cpre\u003e` or ```````````, for\n [code samples](/style/code-samples) or other blocks of code.\n: Do not override or modify font styles inline.\n: Use code font to mark up code, such as filenames, class names, method names, HTTP status codes,\n console output, and placeholders. For more information, see\n [Some specific items to put\n in code font](/style/code-in-text#some-specific-items-to-put-in-code-font).\n\nCapitalization\n: Use American English style for\n [general capitalization](/style/capitalization).\n: Use sentence case in all [headings,\n titles, and navigation](/style/capitalization#capitalization-in-titles-and-headings).\n: Use all-capitals for [placeholders](/style/placeholders#placeholder-text).\n\nQuotation marks\n: In general, use American English style when [punctuating\n quotations](/style/quotation-marks).\n: For titles of shorter works---such as articles or episodes in a web series---put titles in quotation marks, unless\n they're part of a link.\n\nFont type, size, and color\n: Do not override global styles for [font type, size, or\n color](/style/fonts).\n: Use [semantic HTML](/style/semantic-tagging) or Markdown to\n control the style of text on a page---for example, code tags in HTML (`\u003ccode\u003e`)\n or backticks in Markdown (`````)---instead of manually styling text with a monospace\n font.\n\nOther punctuation conventions\n: Don't use [ampersands (\\&)](/style/word-list#ampersand) as conjunctions or\n shorthand for *and* . Use *and* instead. That includes headings and navigation.\n\n **Exception** : It's okay to use *\\&* in cases where you need to refer to a UI\n element or the name of a menu that uses *\\&*.\n: Put quotation marks and end punctuation outside of link text. For more information, see\n the [Punctuation around link text](/style/cross-references#punctuation)\n and [Quotation marks and italics](/style/cross-references#quotation-marks-italics)\n sections of the \"Cross-references and linking\" page."]]