Writing & StyleStyle guide

Formatting Code Elements in Running Text

Formatting Code Elements in Running Text records the relevant Microsoft Style Guide convention while keeping it explicitly house-style scoped rather than presenting it as a universal grammar rule.

Quick answer

Use code style for programmatic or code-related elements in running text unless Microsoft’s developer-formatting table gives a specific exception.

Key details

Core IssueA consistent code style helps readers distinguish literal program elements from explanatory prose.
RegisterMicrosoft technical and professional documentation

Important caveats

Scope Boundary

Capitalization follows the programming language or operating environment; do not editorially change literal code identifiers.

Further guidance

Content

Use code style for programmatic or code-related elements in running text unless Microsoft’s developer-formatting table gives a specific exception.

Purpose

A consistent code style helps readers distinguish literal program elements from explanatory prose.

Sources and evidence

Sources are shown with the role they play in this guide. Historical or style-sensitive claims are kept within the evidence boundary described above.

  1. Formatting developer text elements — Microsoft Style Guide (opens in a new tab)Microsoft · Microsoft Style Guide conventions for formatting programmatic and code-related elements in developer content.

Explore the topic