A fork is an exact copy of a Pen. You can fork any public Pen from the Pen Actions menu. If a Pen is Private, or any of the non-Public options for Privacy, you can only fork it if you own the original Pen. After forking, the new forked Pen will be owned by you. It will have the same name, but a new URL, and will be noted as a fork, so the original is credited, in the Details & Comments section.

Forks are only one-level deep. When a new fork is created from a Pen that is a fork of another Pen, the new fork is considered a child of the original. For example: you create Pen A. Another member forks your Pen to create Pen B. Then, a third member forks Pen B to create Pen C. Pen C is a child of your Pen A, and the credit note in the Details & Comments section will reflect that.

Changed Forks

You can create a fork before making changes to the original Pen. Or you can start editing first, then fork when you’re ready to save your changes. If you don’t have editing access to a Pen, you’ll be prompted to fork the Pen, as otherwise your changes will be lost when leaving the Pen.

Hot tip! If you find yourself forking your own work often remember Pens are Versioned automatically, so you don’t have to fork to make sure you have previous versions of the code. Or if you’re forking a Pen that has useful starter code for you, you may find making a Template more useful.

Forks in “Your Work”

By default, the filters on the Your Work page include forks. But if you prefer, you can choose to exclude them or show only your forked Pens by choosing Forked or Not Forked from the Filters menu.

Forks on Your Profile

We separate your forks from your original Pens on your profile page so visitors to your profile will see your work first. You can find them on profile pages still, categorized underr Pens > Forked.

Fork to a New Browser Tab

Note: This feature is not yet implemented.

You can open your fork in a new tab by pressing Command (Mac) or Control (PC) clicking the Fork button.

Note that popup blockers may block the new tab. If opening your fork is blocked, you can click the “View Fork” link in the banner at the top of the original Pen to go to your fork.

You can adjust your popup settings in your browser to allow codepen.io — forks in a new tab are the only thing we use a “popup” for.

Forks and Search

Forks aren’t shown in search by default, but you can expand your search to include forks by setting “Show forks” to “True” on the search result page.

Forks and Picked Pens

We avoid picking forks, unless they are significantly different from the original.