HN Avatars in 357 bytes
Paste the following into the console of any HN page - for annotated avatars on all HN comments. (self contained code) for(u of document.querySelectorAll('.hnuser'))for(u.prepend(c=document.createElement('canvas')),x=c.getContext('2d'),c.width=18,c.height=14,s=u.innerText,r=1,i=28+s.length;i--;i>>29>X*X/3+Y/2&&x.fillRect(6+2*X,2*Y,2,2)&x.fillRect(6-2*X,2*Y,2,2):r+=s.charCodeAt(i-28,x.fillStyle='#'+(r>>8&0xFFFFFF).toString(16)))r^=r>>17,r^=r>2
In plain words
HN Avatars in 357 bytes is a developer tool that generates unique visual avatars for Hacker News users based on their usernames. Users paste a single line of self-contained JavaScript code into the browser console on any HN page to add small colored pixel avatars next to all comments. The tool creates distinct, procedurally generated graphics for each user without requiring external resources, making it lightweight and immediately functional.
written from the facts on this page · September 2026
From the sources
In the maker’s words, at launch
Paste the following into the console of any HN page - for annotated avatars on all HN comments. (self contained code) for(u of document.querySelectorAll('.hnuser'))for(u.prepend(c=document.createElement('canvas')),x=c.getContext('2d'),c.width=18,c.height=14,s=u.innerText,r=1,i=28+s.length;i--;i<28?r>>>29>X*X/3+Y/2&&x.fillRect(6+2*X,2*Y,2,2)&x.fillRect(6-2*X,2*Y,2,2):r+=s.charCodeAt(i-28,x.fillStyle='#'+(r>>8&0xFFFFFF).toString(16)))r^=r<<13,r^=r>>>17,r^=r<<5,X=i&3,Y=i>>2
More dev tools this month
the category →



Open-source GTM skills for technical founders
Dev tools · 29d ago · gtmcofounder.com

Lettertrace▲375Track your AI visibility for free (using your own API keys!)
Dev tools · 25d ago · lettertrace.com
Launched alongside, March 2022
the whole month →- IM
Hi HN! I made many small web games in the past with Unity or Phaser. But this time I wanted to make something completely on my own. So I coded a basic game framework in plain JavaScript, and used it to make Almost Pong. This was a really fun project that taught me a lot about JavaScript, and I plan to make more minimalist games with this framework. Interesting fact: Almost Pong doesn't load any assets, all sprites and sounds are generated with code. Happy to answer questions, and please let me know if you have any feedback on the game. Thanks!
Dev tools · 2022 · lessmilk.com
- IM
Life & fun · 2022 · networksfromscratch.com


- AG
Life & fun · 2022 · backofyourhand.com
