diff --git a/files/en-us/glossary/base64/index.md b/files/en-us/glossary/base64/index.md index 59d046fbeb367f9..b3936032e280836 100644 --- a/files/en-us/glossary/base64/index.md +++ b/files/en-us/glossary/base64/index.md @@ -14,8 +14,7 @@ When the term "Base64" is used on its own to refer to a specific {{glossary("alg ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/ ``` -A common variant is "Base64 URL safe", which omits the padding and replaces `+/` with `-_` to avoid characters that might cause problems in -{{glossary("URL")}} path segments or query parameters. +A common variant is "Base64 URL safe", which omits the padding and replaces `+/` with `-_` to avoid characters that might cause problems in {{glossary("URL")}} path segments or query parameters. You don't need this encoding if you are not putting the data in a path segment or query parameter — for example, [data URLs](/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs) have neither and can use the standard Base64 encoding. Base64 encoding schemes are commonly used to encode binary data for storage or transfer over media that can only deal with ASCII text (or some superset of ASCII that still falls short of accepting arbitrary binary data). This ensures that the data remains intact without modification during transport. Common applications of Base64 include: diff --git a/files/en-us/web/http/basics_of_http/data_urls/index.md b/files/en-us/web/http/basics_of_http/data_urls/index.md index fdebdaf3e509410..8311299a5dbf339 100644 --- a/files/en-us/web/http/basics_of_http/data_urls/index.md +++ b/files/en-us/web/http/basics_of_http/data_urls/index.md @@ -38,7 +38,7 @@ A few examples: ## Encoding data into base64 format -Base64 is a group of binary-to-text encoding schemes that represent binary data in an {{Glossary("ASCII")}} string format by translating it into a radix-64 representation. By consisting only of ASCII characters, base64 strings are generally url-safe, and that's why they can be used to encode data in Data URLs. +Base64 is a group of binary-to-text encoding schemes that represent binary data in an {{Glossary("ASCII")}} string format by translating it into a radix-64 representation. By consisting only of characters permitted by the URL syntax ("URL safe"), we can safely encode binary data in data URLs. Base64 uses the characters `+` and `/`, which may have special meanings in URLs. Because Data URLs have no URL path segments or query parameters, this encoding is safe in this context. ### Encoding in JavaScript