Choose the destination before encoding

Start by asking where the value will be used. URL encoding is for link components and query parameters. HTML entity encoding is for text that will sit inside markup. Base64 is for ASCII-safe transport of short text. Slugs are readable path labels, not a general encoding format.

  • Use URL encoding for parameter values.
  • Use HTML entities for visible text inside HTML.
  • Use Base64 for short text samples that need ASCII-safe wrapping.
  • Use slugs for final page titles and filenames.

Encode only the part that needs it

Encoding a full URL as one component can make it harder to read or paste into another system. For query strings, encode the parameter value rather than the entire link unless the receiving field explicitly expects an encoded URL.

Decode before reviewing copied values

Copied links, redirects, and logs often contain percent escapes or entity-heavy text. Decode a small snippet first so you can check the actual value before editing it, documenting it, or sharing it in a ticket.

Generate slugs after the title is final

Slug generation belongs near the end of the content workflow. Normalize whitespace, settle the title, review acronyms and product names, and then generate the slug. Use URL encoding only when special characters need to remain as part of a query value.

  • Do not treat Base64 as encryption.
  • Do not use HTML entity encoding for query parameters.
  • Do not fetch decoded URLs unless a separate review step says to.