Base64 Encoding: When and Why to Use It
Learn what Base64 encoding is, how it works, and when to use it. Understand the difference between encoding and encryption, common use cases, and best practices for web development.
I used to ignore URL slugs until I saw the click-through rate difference between /post?id=12345 and /how-to-write-better-code. Now I obsess over them. Here is what I have learned about slugs, SEO, and why every character matters.
A URL slug is the human-readable part of a URL that identifies a specific page. In example.com/blog/my-first-post, the slug is 'my-first-post'. It is the part after the domain and path structure that describes the actual content.
I used to think slugs were trivial - just auto-generate them from the title and move on. Then I analyzed our analytics at Šikulovi s.r.o. and noticed something interesting: pages with descriptive slugs had noticeably higher click-through rates from search results. People actually look at URLs before clicking.
The turning point was when I changed one of our tool pages from /post?id=12345 to /how-to-write-better-code. The content was identical, but the new URL got shared more on social media because people could tell what they were linking to just by reading the URL.
I wish someone had given me these rules when I started. Instead, I learned them through trial and error - watching search rankings and tweaking URLs over time. Here is the formula I use now for every page on CodeUtil.
This one is personal for me. Being Czech, I deal with characters like ř, ž, and č constantly. And I learned the hard way that these characters do not play nice with URLs everywhere.
We had a blog post at Šikulovi s.r.o. with Czech diacritics in the URL. It displayed fine in Chrome, but when someone shared it on LinkedIn, the URL got mangled into percent-encoded garbage. Some email clients stripped the characters entirely. Lesson learned: transliterate everything.
The Slug Generator tool I built handles Czech, German, French, and most European languages automatically. For non-Latin scripts like Chinese or Japanese, you would use romanization systems like pinyin or romaji instead.
Stop words are common words like 'the', 'a', 'and', 'in' that search engines sometimes ignore. Removing them makes slugs shorter: 'how-to-write-better-code' instead of 'how-to-write-a-better-piece-of-code'.
I default to removing them, but not blindly. I once auto-generated a slug for 'The Office Fan Page' and got just 'office-fan-page' - which completely lost the reference. Same problem with 'A vs B Comparison' becoming just 'comparison'. Context matters.
My rule now: if removing the stop words changes the meaning or makes the slug confusing, keep them. For most technical blog posts, removing them improves readability. For titles with cultural references or brand names, think twice.
The slug is just one part of URL optimization. I made mistakes with overall URL structure too before I learned these patterns.
When I help other developers with their sites, the same URL mistakes keep showing up. I have made most of these myself at some point, so no judgment - just learn from my failures:
My default advice: do not change them. I once changed a URL that had been indexed for two years because I thought the new slug was better. Lost about 30% of that page's traffic and it took months to recover. The SEO cost usually outweighs the benefit.
That said, I do change URLs when they are actively harmful - misspelled, offensive, or completely misleading about the content. If you are rebranding and URLs contain the old brand name, redirects make sense too.
When I absolutely must change a URL, I follow a checklist: set up 301 redirects from old to new, update all internal links, submit the change in Google Search Console, and monitor for crawl errors for a few weeks. It is a process, not a quick find-and-replace.
Aim for 3-5 words or under 60 characters. Shorter is better for sharing and memorability. Google doesn't have a strict limit but truncates long URLs in search results. Focus on including your main keyword without padding.
Always hyphens. Google's Matt Cutts confirmed years ago that hyphens are treated as word separators while underscores join words. So 'my-post' is two words to Google, but 'my_post' might be one word. This affects search rankings.
Yes, but moderately. URLs are a ranking factor - pages with keywords in the URL do slightly better than those without. More importantly, good URLs improve click-through rates, which indirectly affects rankings.
Usually no. Dates make URLs longer and signal that content might be outdated. Exceptions: news sites where publication date matters, or content explicitly tied to a specific time period. For evergreen content, skip dates.
Transliterate them to ASCII equivalents. ü becomes u, é becomes e, ñ becomes n. This ensures your URLs work in all browsers, email clients, and systems. The Slug Generator tool handles this automatically for most European languages.
Set up a 301 redirect from the old URL to the new one. This passes most SEO value to the new URL and prevents broken links. Update your internal links, then monitor search console for any issues. Try to avoid this situation by getting slugs right the first time.
Founder of CodeUtil. Web developer building tools I actually use. When I'm not coding, I experiment with productivity techniques (with mixed success).
Learn what Base64 encoding is, how it works, and when to use it. Understand the difference between encoding and encryption, common use cases, and best practices for web development.
Understand JSON Web Tokens (JWT) from the ground up: how they work, their three-part structure, when to use them, security best practices, refresh token strategies, and common implementation mistakes to avoid.
I once spent 4 hours debugging an API call before realizing I'd used encodeURI instead of encodeURIComponent. Here's everything I learned so you don't make the same mistake.