YouTube has a dark theme that it hasn’t made public knowledge. It’s likely YouTube is showing it to select visitors just now but it’s live on the site. The dark theme will only be visible to you if you sign into YouTube and you turn it On. To check if it’s already available, click your profile icon at the top right and check if there is a dark mode option. If not, you’re going to have to make a small edit in your browser’s console to enable the dark theme on YouTube. Here’s what you need to do.
Enable Dark Mode
Visit YouTube and sign in. Open your browser’s console. Right-click inside the YouTube tab and select ‘Inspect’ (in Chrome), or ‘Inspect Element’, (in Firefox) from the context menu.
Your browser’s development tools will open. There is a tab called ‘Console’ on the development tools. Go to this tab and paste the following code. Tap Enter.
var cookieDate = new Date(); cookieDate.setFullYear(cookieDate.getFullYear( ) + 1); document.cookie="VISITOR_INFO1_LIVE=fPQ4jCL6EiE; expires=" + cookieDate.toGMTString( ) + "; path=/";
On Firefox, you will get a warning saying you should be careful when pasting content. Type ‘allow pasting’ in the bar, and then paste the above code snippet. It will generate an error the first time. Paste it again, and tap Enter.
Refresh YouTube. You will see a difference in the UI. Click your user profile dropdown at the top right and select ‘Dark Mode: Off’ from the menu.
A menu will open at the top right with a switch to turn Dark Mode on.
Here’s what it looks like.
How It Works
If you want to know how this works, or what the code that you’re pasting in the console is, we’ve got answers. You are essentially changing the value of a YouTube Cookie. To be specific, this cookie is called “VISITOR_INFO1_LIVE”. By default, YouTube sets a different value for it. The value is what tells YouTube what interface to show you.
When you paste the above code in the Console, you give YouTube a specific value for the VISITOR_INFO1_LIVE cookie. Users who have this value set for the cookie can enable dark mode in YouTube. You will notice that changing the value of the cookie also makes other UI changes to YouTube. The dark mode isn’t the only change. The entire menu that opens from your profile button is new.
This only works if you’re signed into YouTube. If you’re signed out, the VISITOR_INFO1_LIVE cookie’s value cannot be set manually. This cookie will expire after one year. By then, if YouTube hasn’t rolled the dark theme out to everyone, you can set the value of the cookie again.