CodeCodex — Shared Code Repository
Developer writing code on a laptop
Open Source · Wiki-powered · Community-grown

Code smarter.
Ship with CodeCodex.

Find ready-made code in 40+ languages. Copy what you need, change it if you want, and share your fix back with everyone else.

40+ Languages
500+ Snippets
100% Free & Open
merge_sort.py
1# Merge sort — O(n log n)
2def merge_sort(arr):
3  if len(arr) <= 1:
4    return arr
5  mid = len(arr) // 2
6  L = merge_sort(arr[:mid])
7  R = merge_sort(arr[mid:])
8  return merge(L, R)
9
10# → codecodex.com/sort-algorithms/
Copied in 1 click
Python Java Go JavaScript C / C++ Ruby C# PHP Haskell SQL Pascal Perl Scheme VB OCaml Rust Python Java Go JavaScript C / C++ Ruby C# PHP Haskell SQL Pascal Perl Scheme VB OCaml Rust
🌐 Wiki-powered
Developers working together on code
Community improved
500+ code pages & growing
About CodeCodex

A code library that keeps getting better

Most code libraries stay the same forever. CodeCodex is different — it’s a wiki, so anyone can fix a bug or add a better version. The result is a page that improves every day, not just on launch day.

Find code you can use right away

Browse 500+ algorithms, helper functions, and small utilities across 40+ languages.

Edit anything you find

See a bug or have a faster way to write it? Just edit the page — everyone gets the update.

Checked by other developers

Like Wikipedia, but for code. More eyes on a page means fewer mistakes left in it.

40+ programming languages

Python, Java, C++, PHP, Ruby, Go, Haskell, SQL, Rust, and many more.

How It Works

Getting started takes seconds

CodeCodex is built so any developer, beginner or expert, can find, use, and add code right away.

1
🔍

Search the Codex

Use category tags or the search bar to find an algorithm or utility someone has already written.

2
📋

Copy and use it

All code is free to use. Copy what you need into your project — no credit required.

3
✏️

Improve it

Found a bug or a faster way to write it? Edit the page directly so the next person benefits too.

4
🚀

Ask for what’s missing

Can’t find your use case? Request it, and someone in the community can write it for you.

Community Voices

Developers who saved time with CodeCodex

Real feedback from real contributors — from solo developers to engineering teams.

🐍 Python
I was about to spend two hours writing a merge sort from scratch. Found the CodeCodex version in 30 seconds, adapted it, and shipped the feature before lunch.
JM
jmartinez
Backend Engineer, Mexico
☕ Java
The date formatting examples saved my whole team a day of debugging time-zone issues in MySQL. I’ve bookmarked this site for good.
SK
s_kumar
Full-stack Dev, India
💎 Ruby
I like that I can actually improve the snippets I find. It feels like the only code library that’s still alive. I added my first edit last week.
AL
ali_l
Indie Developer, UK
Community

Real developers, adding code every day

CodeCodex grows because people keep sharing what they know, fixing small bugs, and making old pages better.

40+Languages
500+Code Pages
36+Categories
100%Free to Use
Join the Community
Live activity feed
JM
jmartinez
Improved Python merge sort
2m ago
SK
s_kumar
Added Java date formatter
14m ago
AL
ali_l
Requested: Ruby CSV parser
1h ago
PN
p_nguyen
Fixed C++ memory leak example
3h ago
RB
rbrown
Added PHP regex snippet
5h ago

Stay in the loop

Get an email when new code, tutorials, and community updates land on the Codex.