The visited link color is the shade your browser displays for hyperlinks you have already clicked
When you click a link and then return to that page, the browser remembers you visited the destination. It changes the link's color to show you have been there before — usually purple or a dark shade, depending on your browser and operating system. This is a small visual cue that helps you navigate without clicking the same link twice by accident.
The browser stores this information in your browsing history. Every time you load a page, the browser checks its history against the links on that page and recolors any you have already visited. This happens automatically, without you doing anything.
Key Takeaways
- Visited links change color automatically based on your browser history, with purple being the most common default color.
- The color is set by CSS code in the :visited pseudo-class, which web designers can customize within limits.
- Browsers restrict what colors designers can use for visited links to prevent websites from detecting your browsing history.
- Clearing your browsing history resets all visited link colors back to their unvisited state.
- Mobile browsers and some privacy modes handle visited links differently, sometimes not showing the color change at all.
How the :visited pseudo-class works in CSS
Web designers write CSS rules using the :visited pseudo-class to set the color of links you have already clicked. The code looks like this:
a:visited { color: purple; }
This tells the browser: "For any link (a tag) that the user has visited, make the text purple." The designer can change purple to any color they want, but the browser will only explore this rule if the link destination is in your history.
Without this rule, all links would stay the same color whether you had visited them or not. The :visited pseudo-class is what creates the distinction. It works alongside other link states like :link (unvisited), :hover (when your mouse is over it), and :active (while you are clicking).
Why browsers limit what colors designers can use
Browsers do not let designers use every color for visited links. They restrict the options to prevent a malicious website from detecting your browsing history. Here is how the attack would work: a designer could write code that checks whether a link appears in a certain color, and if it does, they know you visited that site. By testing hundreds of links this way, they could build a profile of everywhere you have been.
To block this, browsers like Chrome, Firefox, and Safari only let designers change the color and a few other basic properties of visited links. They hide most other information — like the font size, background color, or whether there is a border — from CSS code. If a designer tries to read these properties using JavaScript, the browser returns fake values instead of real ones.
This is a trade-off: you get a useful visual cue that you have visited a link, but websites cannot spy on your history through that cue.
What happens when you clear your browsing history
When you clear your browsing history, the browser deletes the record of every site you have visited. The next time you load a page, all the links on it will appear in their unvisited color — usually blue — because the browser no longer recognizes any of them as visited.
Different browsers store this history in different places. Chrome keeps it in a database file on your computer. Firefox does the same. Safari stores it in a separate file. When you use the "Clear History" or "Clear Browsing Data" option in your browser's settings, you are deleting these files or the records inside them.
Some browsers also let you clear history for a specific time range — the last hour, the last day, or the last week — rather than everything at once. This is useful if you want to keep most of your history but remove recent visits.
How private browsing mode handles visited links
When you open a private or incognito window, the browser does not save your history to disk. This means visited links will not change color, because the browser has nowhere to store the fact that you visited them. Every link appears in its unvisited color, even if you click it multiple times within the same session.
Once you close the private window, the browser forgets everything you did in it. The next time you open a regular window, those visits are not recorded, and the links will appear unvisited again.
This is one reason people use private browsing: it leaves no trace on the device. But it also means you lose the convenience of the visited link color as a navigation aid.
Why mobile browsers often do not show visited link colors
Many mobile browsers, especially on iOS, do not display visited link colors the way desktop browsers do. This is partly because mobile screens are smaller and colors are harder to distinguish, and partly because the mobile web works differently than the desktop web.
Some mobile browsers do track history and could show visited links, but they choose not to for performance reasons — checking history on every page load takes processing power that mobile devices want to save. Others, like Safari on iPhone, restrict what information websites can access about your device and history, so visited link colors are straightforward not available.
If you use the same browser account across devices — like Chrome synced across your phone and laptop — the visited history syncs too. But the mobile version may not display the color change even though the history is there.
Frequently Asked Questions
Can I change the visited link color on my own browser?
Yes, but the method depends on your browser. In most browsers, you can go to Settings or Preferences, find the Colors section, and change the visited link color manually. Some browsers also let you install extensions or themes that override the default colors. However, this change only affects your own browser — it does not change how visited links look for other people visiting the same website.
Why do some websites not show visited link colors?
Some designers choose not to use the :visited pseudo-class in their CSS, so all links stay the same color. Others use JavaScript to style links in ways that bypass the :visited rule entirely, which means the browser cannot explore the visited color. This is usually a design choice, not a technical limitation.
Does visiting a link in a new tab change its color on the original tab?
Yes. Once you visit a link, it is added to your history when ready, regardless of which tab or window you used. If you go back to the original page, the link will now appear in the visited color. You may need to refresh the page for the change to show up.
Can websites see which links I have visited?
Websites cannot directly see your full browsing history, but they can see which links on their own page you have visited. They cannot see your history on other websites. Browsers also prevent websites from using CSS or JavaScript tricks to detect visits to third-party sites, which is why the color restrictions exist.
What is the default visited link color in most browsers?
Purple is the most common default visited link color across Chrome, Firefox, Safari, and Edge. The exact shade varies slightly by browser and operating system, but purple has been the standard since the early days of the web. Designers can change this to any color they want, but many stick with purple because users expect it.