How to format keyboard shortcuts and key names in markdown using the HTML kbd element. Syntax, examples, and platform support.
Keyboard input formatting uses the HTML <kbd> tag to display key names and shortcuts in a styled box that visually represents a physical key. It is commonly used in documentation and tutorials to indicate what keys to press.
Wrap the key name in <kbd> tags.
Use + between individual key tags to show combinations.
Use unicode symbols for Mac modifier keys.
| Platform | Supported | Notes |
|---|---|---|
| GitHub | Yes | HTML <kbd> rendered |
| GitLab | Yes | — |
| Obsidian | Yes | — |
| Discord | No | HTML not rendered — use backtick inline code instead |
| Notion | Partial | Paste as HTML embed |
| Slack | No | — |
`Ctrl+C`
<kbd>Ctrl</kbd>+<kbd>C</kbd>
Inline code works as a fallback but does not render the key-cap visual style that <kbd> provides.
Use separate <kbd> tags for each key in a combination, joined with + or /. This makes each key visually distinct.
On platforms that don't render HTML (Discord, Slack), use `Ctrl+C` backtick inline code as a readable alternative.
Everything you need to know.
<kbd> is an HTML tag that renders text in a keyboard-key style — typically a small box with a border. It's the standard way to document key presses in technical writing.
Inline code is formatted by wrapping text in single backticks (`). It renders in a monospace font with a subtle background, making it ideal for variable names, commands, file paths, and short code snippets within a sentence.
Most markdown parsers allow you to embed raw HTML directly in your markdown file. HTML blocks let you use elements not supported by markdown — custom divs, details/summary, colored text, form elements, and more. HTML support depends on the platform — some sanitize or strip it entirely.
Bold text in markdown is created by wrapping words with double asterisks (**) or double underscores (__). Bold draws attention to important words and phrases, making your content easier to scan.
Paste your markdown and see keyboard input rendered instantly with professional themes.