40 Sites to find, share & test code snippets online

When you are working on a project, often you come across the need for a block of code that performs a certain function, or display a certain layout.

Some 10 years ago the choices were limited for developers to find such code. The developer had to either create the block himself or post in a community forum in the hope that someone will help him out, or search big code repositories like sourceforge, GitHub etc. That was tiresome.

Now we have websites created specially for the purpose of writing, testing and sharing code. Most such sites are free to use, but some operate a freemium model where basic options are free but paid upgrades give you more options to manage your code.

The Sharing option can be private or public depending on the access level, or the package that you buy (if it is a paid code sharing website).

Code sharing and hosting sites are of the following types

  • Simple text editors where you can write any type of code. You can save and share the code with a link. Typically there is no option to test the code.
  • JavaScript code testing and sharing websites. These websites offer online editors to write and test Java Script code live. You also get links to share your code snippets.
  • CSS code testing and sharing websites. These sites offer online editors to write and test CSS code live. You also get links to share your CSS code snippets.
  • Websites where you can write and test programming languages like PHP, Java, C, C++ etc.

Simple Online Code Editors

Simple online code editors where you can write any type of code. You can save and share the code with a link. Typically there is no option to test code live. Most of these sites are actually simple text editors with fancy options.

  1. Control C
  2. Code Share
  3. Online Html Editor
  4. Snippet
  5. Friend Paste
  6. Edit Pad
  7. New Text Document
  8. Fire Pad
  9. Collab Edit
  10. Just Paste
  11. Write URL
  12. Snipplr
  13. Gist Github
  14. Code Pile
  15. Slexy
  16. Private Bin
  17. Pastie
  18. Meeting Words

HTML, JavaScript and CSS Code testing and sharing sites

These sites usually offer testing and sharing plain HTML, vanilla CSS and JavaScript code, but some offer testing of code using multiple CSS and JavaScript libraries.

  1. Live Weave
  2. JsFiddle
  3. Js Do – write, test and share JavaScript snippets.
  4. JS Bin – offers option to add JavaScript libraries like jQuery for code testing.
  5. Webmaker App – add JavaScript and CSS libraries to write and test code.
  6. CSS Deck
  7. Stack Blitz – create and deploy fullstack apps.
  8. Plnkr – allows code testing in multiple JavaScript libraries
  9. Code Sandbox – write and test code in multiple JavaScript libraries.
  10. Sync Fiddle – collaborate HTML, CSS and JavaScript code
  11. Codepen – you can load external JavaScript libraries for code testing
  12. Codeply – allows code testing of multiple frameworks like Angular, Vue, React, Bootstrap and more.
  13. Livegap Editor

Test and share code written in programming languages

There are websites where you can write and test full programming languages like PHP, Java, C, C++ etc.

  1. Ideone – write, compile, test and share code online.
  2. Sql Fiddle – SQL code testing platform. Create schema and run queries online – all inside the browser.
  3. Code Chef Ide – write, compile, test and share code snippet in programming languages like C, C++, Java, RUBY, PHP, Perl and more.
  4. 3vrl editor – online PHP editor to write, test and share PHP code. multiple PHP versions.
  5. Online PHP Functions Sandbox – online PHP editor. Multiple PHP versions.
  6. Dot Net Fiddle – supported languages C#, VB.NET, F#
  7. Python Tutor – Python and JavaScript code testing and sharing.
  8. Rex Tester – compile and share C# online.
  9. Sqlite Online – test and share SQL queries.