← Article

Visual Studio Code - Selected Text to Uppercase

In Visual Studio we are all used to being able to use CTRL+SHIFT+U to transform the selected text to uppercase but for Visual Studio Code this key binding was left out. As long as you are using _Version 1.8.1 or above_ you will be able to take advantage of the built in keyboard shortcuts. Do the following to enable the keybindings.

In Visual Studio we are all used to being able to use CTRL+SHIFT+U to transform the selected text to uppercase but for Visual Studio Code this key binding was left out. As long as you are using Version 1.8.1 or above you will be able to take advantage of the built in keyboard shortcuts. Do the following to enable the keybindings.

Note: Ubuntu users will need to use a modified binding; change to ctrl+alt+u and ctrl+alt+l.

Open File -> Preferences -> Keyboard Shortcuts (on macOS, Code -> Settings -> Keyboard Shortcuts), then click the Open Keyboard Shortcuts (JSON) icon in the top right of the editor. You can also run Preferences: Open Keyboard Shortcuts (JSON) from the command palette.

A keybindings.json file will open. Place the following JSON in the array and save. If the file already has bindings, add these entries to the existing array.

    [
     {
        "key": "ctrl+shift+u",
        "command": "editor.action.transformToUppercase",
        "when": "editorTextFocus"
     },
     {
        "key": "ctrl+shift+l",
        "command": "editor.action.transformToLowercase",
        "when": "editorTextFocus"
     }
    ]

Ubuntu users:

    [
     {
        "key": "ctrl+alt+u",
        "command": "editor.action.transformToUppercase",
        "when": "editorTextFocus"
     },
     {
        "key": "ctrl+alt+l",
        "command": "editor.action.transformToLowercase",
        "when": "editorTextFocus"
     }
    ]

As soon as you save you will now be able to use CTRL+SHIFT+U to change selected text to uppercase and CTRL+SHIFT+L to change selected text to lowercase.

These keys already have default bindings in current versions of VSCode. On Windows and Linux, CTRL+SHIFT+U shows the Output panel and CTRL+SHIFT+L selects all occurrences of the current selection. Your bindings replace those defaults while the editor has focus. If you use either one, pick different keys. The commands are also available without a shortcut from the command palette as Transform to Uppercase and Transform to Lowercase.

Changelog

2026-10-26

  • Updated how to open keybindings.json. The Keyboard Shortcuts editor now has a button for it.
  • Added a note that these key combinations already have default bindings.

For feedback, ping me on Mastodon@tuck@fosstodon.org.