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.
- Control C
- Code Share
- Online Html Editor
- Snippet
- Friend Paste
- Edit Pad
- New Text Document
- Fire Pad
- Collab Edit
- Just Paste
- Write URL
- Snipplr
- Gist Github
- Code Pile
- Slexy
- Private Bin
- Pastie
- 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.
- Live Weave
- JsFiddle
- Js Do – write, test and share JavaScript snippets.
- JS Bin – offers option to add JavaScript libraries like jQuery for code testing.
- Webmaker App – add JavaScript and CSS libraries to write and test code.
- CSS Deck
- Stack Blitz – create and deploy fullstack apps.
- Plnkr – allows code testing in multiple JavaScript libraries
- Code Sandbox – write and test code in multiple JavaScript libraries.
- Sync Fiddle – collaborate HTML, CSS and JavaScript code
- Codepen – you can load external JavaScript libraries for code testing
- Codeply – allows code testing of multiple frameworks like Angular, Vue, React, Bootstrap and more.
- 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.
- Ideone – write, compile, test and share code online.
- Sql Fiddle – SQL code testing platform. Create schema and run queries online – all inside the browser.
- Code Chef Ide – write, compile, test and share code snippet in programming languages like C, C++, Java, RUBY, PHP, Perl and more.
- 3vrl editor – online PHP editor to write, test and share PHP code. multiple PHP versions.
- Online PHP Functions Sandbox – online PHP editor. Multiple PHP versions.
- Dot Net Fiddle – supported languages C#, VB.NET, F#
- Python Tutor – Python and JavaScript code testing and sharing.
- Rex Tester – compile and share C# online.
- Sqlite Online – test and share SQL queries.