Skip to main content
Back to Tools

Code Screenshot Generator

Create beautiful, shareable code screenshots with syntax highlighting. Perfect for Twitter, LinkedIn, and documentation.

Code
14 lines273 characters
Theme
Background
Style
Quick Presets
Preview
1
2
3
4
5
6
7
8
9
10
11
12
13
14
function fibonacci(n) {
  // Calculate the nth Fibonacci number
  if (n <= 1) return n;
  
  let prev = 0, curr = 1;
  for (let i = 2; i <= n; i++) {
    [prev, curr] = [curr, prev + curr];
  }
  
  return curr;
}

// Example usage
console.log(fibonacci(10)); // Output: 55
Higher = larger file
Tips
  • Use 2x or 3x scale for crisp images on retina displays
  • Gradient backgrounds work best for social media posts
  • Use transparent background for documentation
  • Keep code snippets short (15-25 lines) for readability