Embedded Pens

The Pens you build on CodePen can be displayed on any other site. Nothing beats documentation or tutorials with working code demonstrations.

⬇ Here’s an Embedded Pen ⬇


Embeds are very powerful.

All the power of CodePen in a tiny box.

  • Easy copy & paste code allows you to grab and Pen and bring it anywhere.
  • You customize what you want shown. All preview? Sure. Just the CSS? No problem. Both HTML and Result? You got it.
  • Apply themes so that you can control all the design of all your embeds at once.
  • An optional click-to-play feature makes the embeds extra lightweight.
  • PRO: Make your Embedded Pens editable. A live code editor on your own site!
  • PRO: Unlimited Themes. Have several sites to match the look of? Makes as many themes as you want.
  • PRO: Apply Custom CSS to themes so you have 100% design control.

For your site

Embedded Pens put code and previews on your site.

When you’re demonstrating something about the web, there is nothing better than showing people the real code and the real output of that code. The proof is in the pudding, they say.

Embedded Pens are perfect for:

  • Documentation
  • Blog Posts
  • Tutorials
  • Reduced Test Cases
  • Isolated Demos

Private Pens are embeddable too (just bear in mind they aren’t exactly very private when you do!)

Wanna show just the preview? No problem. How about just the code? Sure. Split between both? That’s a great way to show off the power of code.

It really depends on a Pen-by-Pen basis what makes the most sense to show. Our embeds allow you to customize that easily. Just click which tabs you want active by default.

Variety of CodePen themes with lots of different colors.
  • Regular, Dark, and Light default themes
  • Custom Themes
  • Custom CSS
  • Hiding the Header
  • Fills 100% of vertical and horizontal space
  • Resizeable

Design Control

Your site, your design.

Embedded Pens use themes. Themes control all the styles and colors in use. That way Embedded Pens don’t have to look like CodePen, they can look like you. They can match your brand and your preferences.

Even better: when the look of your site changes, it’s no problem. Just update the theme and all your Embedded Pens using that theme update immediately.

All users have one theme. PRO users get unlimited themes and the ability to apply Custom CSS to themes, giving you 100% design control, including the ability to hide the Tab Bar.

A Live Editor

Embeds can be active editors.

Just like the Editor on CodePen itself! The preview is updated as you type. This is great for encouraging your visitors to play with your code. They don’t have to leave your site to start learning and experimenting.

Among other things, this is feature is great for documentation or for demos where people are expected to customize the code for their needs.

Editable Embeds are a PRO feature.

Editable embed
CodePen embed within WordPress block editor


WordPress, Medium, DEV, Discourse

You can put Embedded Pens just about anywhere. Our default embeds are just a bit of HTML and JavaScript. If you can’t run the script, we offer an <iframe> version.

Many platforms, like Medium, will automatically turn URLs to Pens into Embedded Pens. That’s because CodePen supports oEmbed and is on Embedly. We also have WordPress plugins to provide more options there.