Disable YouTube Audio Normalization

A script for YouTube.
Disable YouTube Audio Normalization

Long time ago in YouTube found that they normalize audio, which find it annoying in a sense I couldn’t feel that punch plus it mess with mastering volume on creator and sound designer. So later found this script \[DEPRECATED, its built into youtube now\] Disable youtube volume normalization (allow true video 100% volume) · GitHub it works like that still, but thanks to Grok I decided to fork it and fix things a bit.

  • Works great on Violentmonkey or Tampermonkey

// ==UserScript==
// @name         YouTube True 100% Volume (Improved)
// @namespace    https://github.com/fa7ad/fa995474f5cb9fe91fb209686881373d
// @version      0.4
// @description  Forces true 100% volume on YouTube videos, bypassing loudness normalization. Adds a toggle button. Updated for late-2026 UI.
// @author       Grok + original authors
// @match        https://www.youtube.com/*
// @match        https://youtube.com/*
// @match        https://m.youtube.com/*
// @grant        none
// @run-at       document-start
// ==/UserScript==

(function () {
    'use strict';

    let fullVolumeEnabled = true;
    let observer = null;
    let button = null;

    function maxVol() {
        document.querySelectorAll('video').forEach(video => {
            if (video.volume !== 1) {
                video.volume = 1;
            }
        });
    }

    function createButton() {
        if (button && button.isConnected) return button;

        const css = `
            .full-volume-btn {
                margin: 0 8px;
                padding: 4px 12px;
                background: transparent;
                color: #fff;
                border: 1px solid #fff;
                border-radius: 9999px;
                font-size: 13px;
                font-weight: 500;
                cursor: pointer;
                transition: all 0.2s;
                white-space: nowrap;
                vertical-align: middle;
            }
            .full-volume-btn:hover {
                background: #fff;
                color: #000;
            }
            .full-volume-btn.active {
                background: #0f0;
                color: #000;
                border-color: #0f0;
            }
            @media (prefers-color-scheme: light) {
                .full-volume-btn {
                    color: #000;
                    border-color: #000;
                }
                .full-volume-btn:hover {
                    background: #000;
                    color: #fff;
                }
            }
        `;

        if (!document.getElementById('full-volume-style')) {
            const style = document.createElement('style');
            style.id = 'full-volume-style';
            style.textContent = css;
            document.head.appendChild(style);
        }

        button = document.createElement('button');
        button.className = 'full-volume-btn' + (fullVolumeEnabled ? ' active' : '');
        button.textContent = '100% Vol';
        button.title = 'Toggle true 100% volume (Alt + V)';

        button.addEventListener('click', (e) => {
            e.preventDefault();
            e.stopImmediatePropagation();
            fullVolumeEnabled = !fullVolumeEnabled;
            button.classList.toggle('active', fullVolumeEnabled);
            if (fullVolumeEnabled) maxVol();
            console.log('[YT Full Volume] Toggle:', fullVolumeEnabled ? 'ON' : 'OFF');
        });

        return button;
    }

    function attachButton() {
        // Prefer modern metadata title, then legacy primary-info, then a few other safe spots
        const candidates = [
            document.querySelector('ytd-watch-metadata #title h1'),
            document.querySelector('ytd-watch-metadata #title'),
            document.querySelector('h1.ytd-video-primary-info-renderer'),
            document.querySelector('#title h1'),
            document.querySelector('ytd-watch-metadata h1'),
            document.querySelector('#above-the-fold #title')
        ];

        const titleContainer = candidates.find(el => el && el.isConnected);
        if (!titleContainer) return false;

        if (!titleContainer.querySelector('.full-volume-btn')) {
            const btn = createButton();
            // Prefer appending after the actual title text
            if (titleContainer.tagName === 'H1') {
                titleContainer.appendChild(btn);
            } else {
                const h1 = titleContainer.querySelector('h1') || titleContainer;
                h1.appendChild(btn);
            }
            console.log('[YT Full Volume] Button attached');
        }
        return true;
    }

    function initObserver() {
        if (observer) return;

        observer = new MutationObserver(() => {
            if (fullVolumeEnabled) maxVol();
            attachButton();
        });

        observer.observe(document.documentElement, {
            childList: true,
            subtree: true
        });
    }

    function main() {
        console.log('[YT Full Volume] Script initialized (v0.4)');

        // Quick initial attempts
        const tryAttach = setInterval(() => {
            if (attachButton()) clearInterval(tryAttach);
        }, 600);

        // Keep volume forced
        setInterval(() => {
            if (fullVolumeEnabled) maxVol();
        }, 1200);

        initObserver();

        // Keyboard shortcut
        document.addEventListener('keydown', (e) => {
            if (e.altKey && e.key.toLowerCase() === 'v' && !e.ctrlKey && !e.metaKey && !e.shiftKey) {
                if (button) button.click();
            }
        }, true);
    }

    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', main);
    } else {
        main();
    }
})();

What changed in 0.4

  • More resilient title-container selectors (covers both classic and the current ytd-watch-metadata layout).
  • Slightly tighter intervals and better connected-element checks.
    Style injection is idempotent.
  • Explicit note that this only forces the HTML5 volume property (loudness normalization bypass). It does not turn off the separate “Stable Volume” DRC feature.
  • Side note in Twitter I left version 0.3 outdated now.

Write a comment