Skip to main content

Stata shortcuts

Your answer helps keep this page right.

Do these shortcuts work for you?

Previous Command, Next Command, Clear Command and Autocomplete are four of the five Command Window shortcuts in the Stata list. Do-file Editor has Execute Selection/File, and also Toggle Comment, Go to Line, Increase Indent and Decrease Indent. General has Focus Results, Print and Close Window.

Start with these

  • Execute Selection/File
  • Previous Command
  • Next Command
  • Focus Command Window
  • Toggle Comment
  • New Variable

Tips for Stata

  • Focus Command Window Ctrl1 and Focus Results Ctrl2 use the first two number keys with the same modifier.
  • Decrease Indent CtrlShiftI uses the keys of Increase Indent CtrlI plus Shift.
  • Clear Command Esc and Autocomplete Tab need no modifier.
Jump to section

Command Window5

ActionShortcut
Previous Command
Next Command
Clear Command
Autocomplete
Focus Command Window

Do-file Editor8

ActionShortcut
Execute Selection/File
Save
Find
Find Next
Go to Line
Toggle Comment
Increase Indent
Decrease Indent

Data Editor4

ActionShortcut
New Variable
Copy
Paste
Find in Data

General3

ActionShortcut
Focus Results
Print
Close Window
Report a problem

GitHub is public. Email is private.

Frequently Asked Questions

How many keyboard shortcuts does Stata have on Windows?

Stata has 20 keyboard shortcuts on Windows, organized into 4 sections: Command Window, Do-file Editor, Data Editor, General. This page lists all of them with searchable, organized shortcut tables.

Which Stata shortcuts should I learn first?

Start with Execute Selection/File (Ctrl+D), Previous Command (Page Up), Next Command (Page Down), Focus Command Window (Ctrl+1), Toggle Comment (Ctrl+/), New Variable (Ctrl+N). The sections on this page list the rest.

Can I download Stata shortcuts as a PDF?

Yes. Click the download button at the top of this page to generate a printable PDF cheat sheet with all 20 Stata shortcuts. The PDF includes organized sections, keycap-style key labels, and space for your own notes.

Where is the official Stata keyboard shortcuts documentation?

The official Stata keyboard shortcuts documentation is available on their website. Every shortcut on this page is sourced from and verified against the official documentation to ensure accuracy.

Do these Stata shortcuts work on all Windows keyboards?

Yes. These shortcuts work on standard Windows keyboards. The modifier keys are Ctrl, Alt, Shift, and the Windows key (⊞). Some laptop keyboards may have compact layouts where certain keys require an Fn modifier to access.

Maintained by