Problem
You’re using SQL Server Management Studio (SSMS) and would like to use Dark Mode. You’ve looked at the configuration options and don’t see a way to configure it.
Solution
Enable SSMS Dark Theme in SSMS 21 and Later
SSMS 21 and later now directly support Dark Mode.
To configure the dark theme in SSMS, go to the menu and select Tools > Options.
In the Options window, go to General and select the Dark color theme.

Enable Dark Theme in SSMS Prior to Version 21
Before we configure SSMS for Dark Mode, we need to note that it’s not something officially supported by Microsoft in SSMS versions 16, 17, 18, etc.
Dark Mode has been available since SSMS 16, but disabled by default.
First, let’s open SSMS and look at the existing color schemes available.
- Tools
- Options…

- Environment
- General
- Expand ‘Color theme’ dropdown

And we see the default of Blue, Blue (Extra Contrast), and Light.
- Blue – default color scheme
- Blue (Extra Contrast) – indistinguishable from Blue
- Light – blue areas become grayish for very little contrast
We’re going to be adding a fourth option to that list.
Close SSMS.
Edit File ssms.pkgundef
We’re going to be making an edit to a file called ssms.pkgundef. Before we continue, let’s look at what pkgundef files are. Pkgundef files are generated by Microsoft Visual Studio and they are used to remove features from an application by deleting specific registry keys. Essentially, when an application is started the feature is enabled then disabled. This is reason you’ll see the reverse logic of enabling a feature by commenting it out.
Now, find the ssms.pkgundef configuration file. The following table has the default file location depending on your SSMS version.
| SSMS Version | Ssms.pkgundef File Location |
|---|---|
| 16 | C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio |
| 17 | C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio |
| 18 | C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE |
Hopefully you’ve been keeping up with updates and are using at least SSMS 18 and will find the file in C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE. I’m using SSMS 18.11.1 which is the latest version as of the time of writing to write this tip.
Open the text editor of your choosing as Administrator. Running as Administrator will avoid permission problems when you save the file.

- Yes, if prompted by UAC

- Browse to folder containing ssms.pkgundef
- All Files
- Select ssms.pkgundef
- Open

- Scroll until you get to ‘// Remove Dark theme’
- Add ‘//’ to the beginning of the ‘[$RootKey$\Themes\{1ded0138-47ce-435e-84ef-9ec1f439b749}]’ line to comment it out

- Save the file

Alternatively, you may prefer to run a script rather than manually editing the ssms.pkgundef file. The following PowerShell will search each of the three default SSMS install directories for ssms.pkgundef and will add the two forward slashes ‘//’ in front of the ‘[$RootKey$\Themes\{1ded0138-47ce-435e-84ef-9ec1f439b749}]’ line to comment it out. Remember to run it as Administrator.
# original script https://dba.stackexchange.com/questions/295714/changing-ssms-settings-via-powershell
# ssms 16
If (Test-Path 'C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\ssms.pkgundef')
{
powershell -Command "(Get-Content 'C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\ssms.pkgundef') -replace '\[\`$RootKey\`$\\Themes\\{1ded0138-47ce-435e-84ef-9ec1f439b749}\]', '//[`$RootKey`$\Themes\{1ded0138-47ce-435e-84ef-9ec1f439b749}]' | Out-File 'C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\ssms.pkgundef'"
}
# ssms 17
ElseIf (Test-Path 'C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\ssms.pkgundef')
{
powershell -Command "(Get-Content 'C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\ssms.pkgundef') -replace '\[\`$RootKey\`$\\Themes\\{1ded0138-47ce-435e-84ef-9ec1f439b749}\]', '//[`$RootKey`$\Themes\{1ded0138-47ce-435e-84ef-9ec1f439b749}]' | Out-File 'C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\ssms.pkgundef'"
}
# ssms 18
ElseIf (Test-Path 'C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\ssms.pkgundef')
{
powershell -Command "(Get-Content 'C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\ssms.pkgundef') -replace '\[\`$RootKey\`$\\Themes\\{1ded0138-47ce-435e-84ef-9ec1f439b749}\]', '//[`$RootKey`$\Themes\{1ded0138-47ce-435e-84ef-9ec1f439b749}]' | Out-File 'C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\ssms.pkgundef'"
}
Else {Write-Output 'ssms.pkgundef not found'} 
Change Color Theme in SSMS
Reopen SSMS and navigate to the ‘Color theme’ dropdown as we did earlier. Now, we will see a fourth option for Dark Mode.

- Select Dark
- OK

SQL Server Management Studio Dark Mode Display Examples
Here is what SSMS dark theme looks like now now:

Unfortunately, it only changes the Ribbon and the Query Window. Object Explorer and Results Grid are not changed. But if you’re primarily in the Query Window to write T-SQL scripts and stored procedures, you get this experience.

This change is overwritten when you upgrade SSMS, but as you’ve seen the change is easy to make.
You’ve likely configured Dark Mode in SSMS because you’re a fan of it. But if you decide you don’t like it it’s a simple matter to change it to one of the other three options.
Reasons for using Dark Mode
While there is no conclusive evidence to support medical claims, these are some of the reasons a user would prefer Dark Mode over Light Mode.
- Less light coming back toward your eyes
- Less glare
- It just looks better to them
- Reduced eye strain
- Less energy used
- Extended laptop battery charge
- Reduced blue light exposure
- Easier to read
- Reduced eye dryness
History of Dark Mode
Let’s look at a brief history of computer displays. Dark Mode simply means a dark, or unlit screen background that is displaying lit up text or graphics. Early computer screens were Cathode Ray Tubes (CRT) that were developed for radar systems during WWII. It simply wasn’t practical with this technology to light up an entire screen, so the screen was dark, and the characters were lit up. These screens were Dark Mode even it wasn’t referred to by name at the time. They were just called computer screens.
To show how those screens looked, here is a picture of an International Business Machines (IBM) Personal Computer with a monochrome monitor and an Applied Digital Data Systems (ADDS) Viewpoint dumb terminal. Text was displayed in green (and sometimes in amber or white) on a dark unlit background. Both date back to the 1980s.


As color monitors and graphics video cards became the norm and CRTs gave way to Liquid Crystal Displays (LCD), text and graphics were able to be displayed on a white background to look more like a page printed on paper. And as with so many things, it’s gone full circle and Dark Mode has come back into fashion. What’s old becomes what’s new again.
Next Steps
- If you’re looking for additional SSMS tips to help manage your SQL database, you can find a wealth of them here: SQL Server Management Studio Tips.
- Here are more SSMS Productivity Tips.

Joe Gavin is from Greater Boston and has worked in technology as a Field Service Engineer for an automotive dealer computer system vendor, a Technical Consultant and Operations Analyst with Sybase and SQL Server based database applications in financial services and now works as a SQL Server Database Administrator.
- MSSQLTips Awards:
- Achiever Award (75+ Tips) – 2024 | Author of the Year – 2021 | Author Contender – 2024 |
- Rookie Contender – 2018
ty this works with me
For SSMS 20, I have added the beloe elseif and it works.
# ssms 20
ElseIf (Test-Path ‘C:\Program Files (x86)\Microsoft SQL Server Management Studio 20\Common7\IDE\ssms.pkgundef’)
{
powershell -Command “(Get-Content ‘C:\Program Files (x86)\Microsoft SQL Server Management Studio 20\Common7\IDE\ssms.pkgundef’) -replace ‘\[\`$RootKey\`$\\Themes\\{1ded0138-47ce-435e-84ef-9ec1f439b749}\]’, ‘//[`$RootKey`$\Themes\{1ded0138-47ce-435e-84ef-9ec1f439b749}]’ | Out-File ‘C:\Program Files (x86)\Microsoft SQL Server Management Studio 20\Common7\IDE\ssms.pkgundef'”
}
Thank you Joe!
This was very helpful for people still using those versions. Short and to the point, love it!
genius!
Haven’t seen it for myself yet but version 21 finally has easily configurable dark mode.
Personally speaking, have moved on to Azure Data Studio. Have to use SSMS every once in a while, for administration stuff. The switch to a bright white background was visually uncomfortable. Glad I found this article, Thanks Joe.
I was right there with you…for a moment. Azure Data Studio (ADS) is great, and it’s more than just light and dark mode. There are actual themes that you can download (safely) and really customize it to look great. There are two problems, though:
1. ADS does not always work for the types of databases that I need, such as Azure / Dataverse.
2. ADS is being retired and will no longer be supported at all after Feb 2026.
Microsoft is encouraging everyone who uses ADS to move to Visual Studio Code with the MS SQL extension. VS Code is another fantastic tool, but the MS SQL extension is still somewhat in its infancy. It also has trouble working with non-standard SQL databases.
For now, SQL Shades is the only third-party tool I’ve found that works with SSMS in terms of getting all the panes to light or dark.
Why the heck did the powers that be hid the dark mode by default?
Because it’s incomplete. There are still a few panes in SSMS v20 that don’t embrace all that is dark.
This works! Thanks a lot!
At least my eyes will have a rest from bright white light :)
SSMS 20.0 still not 64-bit and resides in the “C:\Program Files (x86)\Microsoft SQL Server Management Studio 20\Common7\IDE\” folder.
Thanks Denis. Maybe someday.
Hello,
Good tip! To be kept for further usage ;-)
Unfortunately, SSMS is not totally ready for dark mode, some parts are not parametrized to follow the modes’ guidelines (Activity monitor, Object explorer, Registered servers and so on…)
You are a genius, thank you for your help.
Do a google search for “SQL Shades” This is 100% FREE and legit. I was a beta tester for it and it is a plugin to SSMS that will allow a much better support to a TRUE dark mode. No more jumping through hoops because MS is too damn lazy and refused to listen to their customers. This was at one point for years the top most requested item but the manager of SSMS was trying to force people onto AZURE which is crapola!
sqlshades.com
There is no charge for this the dev decided to keep it free for all to use.
Hello All,
In windows server 2019 , and windows server 2016 enable high contrast theme.(works for windows 8,10 and 11)
There are 4 themes , select any one.
Open SSMS.
Entire SSMS will be dark, Query window , left database pane and output window.
Very eazy, I have not tried for 2012.
Thank you so much sir..so helpful. Really.
I’ve finally figured out why a lot of Developers like the Dark Mode… Light attracts bugs. :D
They don’t include dark mode so you’ll switch to Azure Dev Studio, which I dislike. But I’m old.
Thanks for the comments Miguel. I love writing about simple things that are helpful.
I just installed SSMS 19 on Preview and Dark theme looks great with your hack! Thank so much, Joe! I love working in dark theme, almost as much as I love simple hacks like this. For years I’ve struggled setting the entire PC on High Contrast, but that makes selecting and other views difficult. I’ve even gone through the wysiwyg fudge back in 1992, i.e. before Windows on DOS, and hated it. But everyone is still stuck on first gear on Lotus 1-2-3 for DOS. Even people that were not even born back then. You know, leaving margins on the left and top of an Excel Spreadsheet, agonising with the A1 notation when R1C1 makes more sense. It’s like the story of “Mom, why do we have to cut the back end chicken to roast it?” Mom: “your great grandma said that’s how’s done. End of.” It turns out great grandma only had a tiny roasting pan…
Thanks : )
The colors of text and the background in the object explorer have no contrast between them it’s hard to read the text. Also the results pane is not dark. The dark theme is pretty much useless. This looks like still a work in progress. Otherwise MS would have released it.
What i dont get is why they wont just put in a dang darkmode yet, why make people edit this obscure file to access the darkmode >.>