<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/compress-links-for-optimal-qr-codes-bdwdbx3ya" -->

---
title: Compress Links For Optimal QR Codes | daily.dev
description: A project called Ha.mr offers an alternative to traditional link shorteners by compressing URLs instead of storing them in a third-party database. Because the...
canonical: https://daily.dev/posts/compress-links-for-optimal-qr-codes-bdwdbx3ya
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Compress Links For Optimal QR Codes | daily.dev
og:description: A project called Ha.mr offers an alternative to traditional link shorteners by compressing URLs instead of storing them in a third-party database. Because the...
og:url: https://daily.dev/posts/compress-links-for-optimal-qr-codes-bdwdbx3ya
og:image: https://api.daily.dev/og/posts/bdwdBX3YA.png
og:image:alt: Compress Links For Optimal QR Codes
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Compress Links For Optimal QR Codes

**[Hackaday](https://daily.dev/sources/hackaday)** · 2 min read · 1 upvotes · 0 comments

## Summary

A project called Ha.mr offers an alternative to traditional link shorteners by compressing URLs instead of storing them in a third-party database. Because the encoding and compression algorithms are open source, users can verify where a link goes or self-host the service themselves. It also generates QR codes optimized for the QR alphanumeric character set rather than full UTF-8 byte mode, making them easier to scan at smaller sizes. The creator built it as a side project without guarantees of long-term availability, but its open-source nature means anyone can run their own instance.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://hackaday.com/2026/08/18/compress-links-for-optimal-qr-codes>

## Questions this post answers

### Why do QR codes generated from random shortened URLs take up more space than necessary?

Random-looking short URLs typically use characters outside the QR code's built-in alphanumeric character set, forcing the QR encoder into byte mode, which requires significantly more space than the dedicated alphanumeric mode. Reducing the bits needed to store the data allows a QR code to be scanned more easily at the same physical size, which is why compressing text into the alphanumeric set rather than random shortcodes produces easier-to-scan codes.

_Anyone optimizing QR codes for scannability can find related open-source tooling discussions on daily.dev._

### What is the security downside of using a traditional URL shortener like TinyURL?

Traditional URL shorteners generate a random code mapped to the original link in a third-party database, making the actual destination completely non-transparent to the user before they click. This opens the door to abuse, such as redirecting to unexpected or malicious content, since the traffic and the mapping both depend on trusting an external service's database and intentions.

_Developers weighing link shortener risks versus transparency can explore open-source alternatives on daily.dev._

## Similar posts on daily.dev

- [Hand‑drawn QR codes](https://daily.dev/posts/hand-drawn-qr-codes-nygvh2gtx) · Hacker News · 3 upvotes · 0 comments
- [Guide to \(not\) fucking up QR codes](https://daily.dev/posts/guide-to-not-fucking-up-qr-codes-kukypm6ck) · Lobsters · 1 upvotes · 0 comments
- [Phishing on the Edge of the Web and Mobile Using QR Codes](https://daily.dev/posts/phishing-on-the-edge-of-the-web-and-mobile-using-qr-codes-lowdlbqcr) · Unit 42 · 0 upvotes · 0 comments

---

Tags: [#open-source](https://daily.dev/tags/open-source), [#self-hosting](https://daily.dev/tags/self-hosting), [#compression](https://daily.dev/tags/compression)

[View this post on daily.dev](https://daily.dev/posts/compress-links-for-optimal-qr-codes-bdwdbx3ya)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Compress Links For Optimal QR Codes","url":"https://daily.dev/posts/compress-links-for-optimal-qr-codes-bdwdbx3ya","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/compress-links-for-optimal-qr-codes-bdwdbx3ya"},"datePublished":"2026-08-19T02:29:37.189Z","dateModified":"2026-09-14T06:06:53.796Z","description":"A project called Ha.mr offers an alternative to traditional link shorteners by compressing URLs instead of storing them in a third-party database. Because the...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/755b63b882b8c0c66ad165d3dbd89818?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/755b63b882b8c0c66ad165d3dbd89818?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Hackaday","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Hackaday","logo":"https://media.daily.dev/image/upload/s--JhDfhy70--/f_auto,q_auto/v1767541814/logos/hackaday","url":"https://daily.dev/sources/hackaday"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/compress-links-for-optimal-qr-codes-bdwdbx3ya","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"open-source,self-hosting,compression","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Hackaday","item":"https://daily.dev/sources/hackaday"},{"@type":"ListItem","position":3,"name":"Compress Links For Optimal QR Codes"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/compress-links-for-optimal-qr-codes-bdwdbx3ya#faq","mainEntity":[{"@type":"Question","name":"Why do QR codes generated from random shortened URLs take up more space than necessary?","acceptedAnswer":{"@type":"Answer","text":"Random-looking short URLs typically use characters outside the QR code's built-in alphanumeric character set, forcing the QR encoder into byte mode, which requires significantly more space than the dedicated alphanumeric mode. Reducing the bits needed to store the data allows a QR code to be scanned more easily at the same physical size, which is why compressing text into the alphanumeric set rather than random shortcodes produces easier-to-scan codes. Anyone optimizing QR codes for scannability can find related open-source tooling discussions on daily.dev."}},{"@type":"Question","name":"What is the security downside of using a traditional URL shortener like TinyURL?","acceptedAnswer":{"@type":"Answer","text":"Traditional URL shorteners generate a random code mapped to the original link in a third-party database, making the actual destination completely non-transparent to the user before they click. This opens the door to abuse, such as redirecting to unexpected or malicious content, since the traffic and the mapping both depend on trusting an external service's database and intentions. Developers weighing link shortener risks versus transparency can explore open-source alternatives on daily.dev."}}]}
```

