Compare with documentURI. Same location string on typical HTML pages.
Compare with location.href. Usually the same in the active browsing context.
Log the value. See the full address once.
Choose by need. String only → document.URL; navigate/parts → location.
Compatibility
Browser Support
Document.URL is Baseline Widely available (MDN: since July 2015). Safe to use in modern and older evergreen browsers.
✓ Baseline · Widely available
Document.URL
Read-only document location string — supported across browsers for years.
99%Widely available
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
document.URLExcellent
Bottom line: Safe for production. Use document.URL (or documentURI) to read the address; use location when you need navigation or URL parts.
Frequently Asked Questions
A read-only string with the document location — the full address of the current page (MDN).
No. MDN marks Document.URL as Baseline Widely available (since July 2015). It is not Deprecated, Experimental, or Non-standard.
On typical pages they return the same string. document.URL is the familiar name; documentURI is the standards-oriented Document alias.
No. It is read-only on Document. To navigate, use location.href, location.assign(), location.replace(), or the History APIs.
Both often return the same string on the active page. Use location when you also need to navigate or read pathname, search, and hash. Use document.URL when you only need the location string from a Document.
Yes — it is the full location string, typically including path, query (?key=value), and fragment (#section) when present.