ENCODEURL Function
Makes text safe to put inside a web address.
Category
Web
Available in
Excel 2013+ for Windows, Microsoft 365 (not Mac or the web)
Returns
URL-encoded text
Overview
Web addresses can't contain spaces, ampersands or many other characters. ENCODEURL replaces each of them with a % code — a space becomes %20, & becomes %26 — so the text can go into a URL.
Letters, digits and the characters - _ . ~ stay as they are. Use it when building links or WEBSERVICE requests from cell values.
Syntax
Arguments
| Argument | Required? | What it does |
|---|---|---|
| text | Yes | The text to encode — usually one part of a URL, such as a search term. |
Examples
Example 1 — Encode search terms
Spaces, ampersands and accented letters all become % codes.
| A | B | |
|---|---|---|
| 1 | Text | Encoded |
| 2 | Q1 Sales.xlsx | Q1%20Sales.xlsx |
| 3 | Smith & Sons | Smith%20%26%20Sons |
| 4 | Café | Caf%C3%A9 |
| 5 | north-region_2026 | north-region_2026 |
Example 2 — A clickable map link for each customer
Encode only the address part, then join it onto the fixed start of the URL.
Common mistakes
- Encoding the whole URL. ENCODEURL("https://…") also encodes the : and / characters and breaks the link. Encode just the values you insert.
Notes
- Related functions: HYPERLINK, WEBSERVICE, FILTERXML, SUBSTITUTE.

Author
Kyle Stott
Certified Microsoft Excel Expert
Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.