Back to Documentation

Code Snippets

Store and organize code in any programming language

Supported Languages

JavaScript, Python, Java, C++, HTML, CSS, PHP, Ruby, Go, Rust, SQL, JSON, Markdown, and 40+ more

Syntax Highlighting

Code appears exactly as in your editor with proper colors for keywords, strings, comments, and functions

Full-text Search

Search within code content to find that function you wrote months ago

One-click Copy

Copy code with formatting preserved, perfect for sharing or pasting back into your editor

Example: JavaScript

function calculateTotal(items) {
    return items.reduce((sum, item) => {
        return sum + item.price * item.quantity;
    }, 0);
}

const cart = [
    { name: 'Laptop', price: 999, quantity: 1 },
    { name: 'Mouse', price: 25, quantity: 2 }
];

console.log(`Total: $${calculateTotal(cart)}`);

Example: Python

def fibonacci(n):
    if n <= 1:
        return n
    return fibonacci(n-1) + fibonacci(n-2)

for i in range(10):
    print(f"F({i}) = {fibonacci(i)}")
Auto-detection: Don't worry about selecting the right language — we automatically detect it from your code.

Start storing code Learn about notes