Skip to content
All referenceText Formatting

Markdown Keyboard Input

How to format keyboard shortcuts and key names in markdown using the HTML kbd element. Syntax, examples, and platform support.

What is markdown keyboard input?

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.

Syntax

Single key

Wrap the key name in <kbd> tags.

Result
Enter

Key combination

Use + between individual key tags to show combinations.

Result
Ctrl+C

Mac shortcut

Use unicode symbols for Mac modifier keys.

Result
+Shift+P

Platform support

PlatformSupportedNotes
GitHubYesHTML <kbd> rendered
GitLabYes
ObsidianYes
DiscordNoHTML not rendered — use backtick inline code instead
NotionPartialPaste as HTML embed
SlackNo

Common mistakes

Wrong
`Ctrl+C`
Right
<kbd>Ctrl</kbd>+<kbd>C</kbd>

Inline code works as a fallback but does not render the key-cap visual style that <kbd> provides.

Tips for keyboard input

1Wrap each key separately

Use separate <kbd> tags for each key in a combination, joined with + or /. This makes each key visually distinct.

2Fallback to inline code

On platforms that don't render HTML (Discord, Slack), use `Ctrl+C` backtick inline code as a readable alternative.

Frequently asked questions

Everything you need to know.

1

What does <kbd> do in markdown?

<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.

Related elements

Try it in the editor

Paste your markdown and see keyboard input rendered instantly with professional themes.