Microsoft Edge User Agent String: What It Is and How It Works
In this article
The user agent string name for Microsoft Edge is not a single fixed word; it is a formatted string that begins with Mozilla/5.0 and includes Edg/ followed by the version number. For example, a typical Edge user agent string looks like: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0. The key identifier is the Edg/ token (without the 'e' at the end), which distinguishes Edge from Chrome and other Chromium-based browsers. This is a standard technical identifier, not slang or informal language, and it is used by web servers and scripts to detect the browser and tailor content or features accordingly.
Background: What Is a User Agent String?
A user agent (UA) string is a line of text that a web browser sends to every website it visits. It tells the server which browser, version, and operating system the visitor is using. This information helps websites deliver optimized content, apply compatibility fixes, or block known malicious bots. The format of UA strings is loosely standardized by the W3C and IETF, but in practice each browser vendor crafts its own string, often mimicking others for compatibility. Microsoft Edge, built on the Chromium engine since 2020, uses a UA string that closely resembles Google Chrome's, with a distinct token added at the end.
How the Edge User Agent String Is Structured
Edge's UA string follows the common pattern used by Chromium-based browsers. It includes several components:
- Mozilla/5.0 – A historical token kept for compatibility with older servers that expect it.
- Platform details – In parentheses, such as
(Windows NT 10.0; Win64; x64)for Windows 10/11 64-bit, or(Macintosh; Intel Mac OS X 10_15_7)for macOS. - AppleWebKit/537.36 – The rendering engine token, inherited from Chromium's WebKit roots.
- KHTML, like Gecko – Another compatibility token.
- Chrome/ – The Chromium version Edge is based on (e.g.,
Chrome/120.0.0.0). - Safari/537.36 – A token that Chromium-based browsers include to satisfy scripts that check for Safari.
- Edg/ – The unique Edge identifier, followed by the Edge version number (e.g.,
Edg/120.0.0.0). Note the spelling: Edg/, not Edge/. The shorter form was introduced to avoid conflicts with the older EdgeHTML-based Edge, which used Edge/.
On mobile devices, the platform section changes. For example, on Android: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36 EdgA/120.0.0.0. Here the token is EdgA/ for Edge on Android, and EdgiOS/ for Edge on iOS. These variations help servers distinguish between desktop and mobile Edge.
How Websites Use the Edge User Agent String
Web servers and client-side scripts parse the UA string to detect the browser. For Edge, they look for the Edg/ token (or its mobile variants). This allows sites to:
- Serve Edge-specific CSS or JavaScript fixes.
- Recommend installing the Edge browser or its extensions.
- Block or allow certain features based on browser capabilities.
- Collect analytics about browser market share.
Because Edge shares the Chromium engine with Chrome, many sites treat it identically, but the Edg/ token lets them apply Edge-specific tweaks if needed. For example, a site might detect Edge to enable a smoother scrolling behavior or to avoid a Chrome-only bug.
Common Problems and Misconceptions
One frequent misconception is that Edge's UA string contains the word "Edge" spelled out. In fact, the desktop token is Edg/ (three letters), while older versions of Edge (EdgeHTML) used Edge/. This change can break poorly written detection scripts that look for "Edge" and fail on modern Edge. Another issue: some privacy tools or extensions spoof the UA string, making Edge appear as Chrome or Firefox. This can cause websites to serve incorrect content or break functionality. Additionally, because Edge's UA string includes "Chrome/" and "Safari/", naive detection scripts might misidentify Edge as Chrome or Safari. Always check for the Edg/ token first when writing browser detection code.
How to Choose the Right Detection Method
If you are building a website or script, you have several options for detecting Edge:
- User agent sniffing – Parse the UA string for Edg/. This is simple but fragile because users can spoof the string.
- Feature detection – Use JavaScript to check for specific APIs or behaviors rather than relying on the browser name. This is more robust and future-proof.
- Client Hints – Modern browsers, including Edge, support User-Agent Client Hints, which provide a more structured way to get browser and platform information. However, Client Hints are not universally supported by all servers yet.
For most cases, feature detection is recommended. If you must use UA sniffing, check for Edg/ before checking for Chrome/ to avoid misidentification.
Comparing Edge to Other Browsers' User Agent Strings
Edge's UA string is nearly identical to Chrome's, except for the trailing Edg/ token. For example:
- Chrome:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 - Edge:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0 - Firefox:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0 - Safari:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15
This similarity means that many sites treat Edge as Chrome, which is generally fine because they share the same engine. However, Edge-specific features (like certain accessibility tools or enterprise policies) might require detection via the Edg/ token.
Frequently Asked Questions
What is the user agent string for Microsoft Edge on Windows?
On Windows 10 or 11, a typical Edge user agent string is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0. The version numbers vary depending on the installed Edge and Chromium versions.
Why does Edge's user agent include "Chrome"?
Edge is built on the Chromium open-source project, which is also the base for Google Chrome. To ensure compatibility with websites that expect Chrome, Edge includes the Chrome/ token. The Edg/ token at the end identifies it as Edge.
What is the difference between "Edg/" and "Edge/" in user agent strings?
Edge/ was used by the legacy EdgeHTML-based Edge browser (version 18 and earlier). Modern Chromium-based Edge uses Edg/ to avoid confusion and to signal the new engine. Detection scripts should look for Edg/ for current Edge.
How can I detect Edge in JavaScript?
You can check if navigator.userAgent includes "Edg/". For example: if (navigator.userAgent.indexOf("Edg/") !== -1) { /* Edge */ }. Be aware that users can spoof this string, so feature detection is more reliable.
Does Edge on mobile have a different user agent?
Yes. Edge on Android uses EdgA/ and Edge on iOS uses EdgiOS/ instead of Edg/. The rest of the string follows the mobile platform's typical format.
Can I change Edge's user agent string?
Yes, you can override the user agent in Edge's developer tools (press F12, then open the Network conditions panel or use the Device Toolbar). Some extensions also allow spoofing. However, changing the UA string can break websites and is not recommended for regular browsing.