• un
  • Run
  • Go PRO

JSFiddle - Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle.

AI Code Completion

AI Code Completion is a BYOK implementation.

Get your API Key →

The model we use is Codestral by Mistral.

We won't save your API Key in our database, it's only stored in the browser for your convinience.

Your recent fiddles

Collections PRO

Select collections:

  • New collection

Resources CDNJS

  • Type a library name to fetch from CDNJS
  • URL - add directly into the HTML panel as a SCRIPT or LINK

Async requests

Simulating async requests:

  • JSON /echo/json/
  • JSONP /echo/jsonp/
  • HTML /echo/html/
  • XML /echo/xml/

See docs for more info.

Changelog

JSFiddle Apps

  • Coder Fonts
  • Color Palette Generator
  • CSS Flexbox Generator
  • Sign in

Code panel options

Change code languages, preprocessors and plugins

Language

Doctype

Body tag

Language

Extensions

script attribute

Language

Reset CSS

  • This fiddle has previously unsaved changes. Apply changes Discard

Color Palette Generator

Generate a cool color palette with a few clicks

CSS Flexbox Generator

Generate your CSS Flexbox layout in the simplest of ways

Coder Fonts

Curated list of quality monospace fonts for coders

Share or embed fiddle

Customize the embeddable experience for websites

Tabs:

Visual:

Embed snippet Prefer iframe?:

No autoresizing to fit the code

Render blocking of the parent page

Editor settings

Customize the behavior and feel of the editor

Behavior

General

Indent size:
Font size:
Font family:

Console

Your recent fiddles

Recently created fiddles, including ones created while logged out

JSFiddle changelog

A log of all the changes made to JSFiddle – big and small.

  • Curated list of monospace coder fonts

    You can now use different monospace fonts in the editor − we now have a curated list of pretty awesome fonts available including premium ones. Just open the Coder Fonts mini-app from the sidebar or from Editor settings. My current favorites are Input and Commit Mono.

  • CSS Flexbox generator as a JSFiddle app

    Our CSS Flexbox generator lets you create a layout, and skip knowing the confusing properties and value names (let's be honest the W3C did not make a good job here). Not gonna lie, this was heavily inspired by flexer.dev but coded completely from scratch.

  • Behavior change for External Resources

    Adding External Resources will no longer create a list of resources in the sidebar but will be injected as a LINK or SCRIPT tag inside of the HTML panel.

  • Code Completion with additional context

    The Code Completion will now also have the context of all panels before suggesting code to you - so if for example you have some CSS or JS, the HTML panel will suggest code based on the other two panels.

  • 🦄 AI Code Completion (beta)

    Introducing some AI sprinkle in the editor - Code Completion based on the Codestral model (by Mistral).

    For now it's a BYOK implmentation which means you need to provide your own API Key − you can get it for free.

  • Editor switch from CodeMirror to Monaco (same as VSCode)

    After much deliberation I've decided to make the switch from CodeMirror to Monaco.

    There's a few reasons for this. CodeMirror 5 is no longer being developed, and the switch to 6 would be a huge rewrite since there's not much compatibility between the two versions.

    Monaco itself has lots of features already built-in, things that took quite a few external plugins to get into the CodeMirror implementation.

    I'm incredibly thankful to Marijn for his work on CodeMirror, it has served well for many years.

  • JSFiddle will load faster

    Technical debt is a drag man. Remember the time when MooTools was state-of-art JS framework? We do and so much of JSFiddle was still dependant on it till this day, but since almost all MooTools features are now available in native JS it was high-time to strip it out of the codebase.

    This took around a week of work, lots of testing, but it's now done. And the final package of our JS bundle is ~30% smaller.

Add a new collection

Collect your fiddles in collections

Get a Mistral API Key

A short guide to getting a free Mistral API Key.

  • Sign up for a Mistral account, and pick the free Experiment subscription plan.

  • Log in, and go to your organization's API Keys section.

  • Click Create new key, fill "JSFiddle" as the name for the API key, and save.

  • Copy the key, and paste it into JSFiddle − under the AI Code Completion in the Sidebar.

  • Done! AI Code Completion should now be working.

Set fiddle expiration

Please Whitelist JSFiddle in your content blocker.

Help keep JSFiddle free for always by one of two ways:

  • Whitelist JSFiddle in your content blocker (two clicks)
  • Go PRO and get access to additional PRO features →
  • Ad-free

    All ads in the editor and listing pages are turned completely off.

  • Use pre-released features

    You get to try and use features (like the Palette Color Generator) months before everyone else.

  • Fiddle collections

    Sort and categorize your Fiddles into multiple collections.

  • Private collections and fiddles

    You can make as many Private Fiddles, and Private Collections as you wish!

  • Console

    Debug your Fiddle with a minimal built-in JavaScript console.

  • Early AI features

    Try the AI features we're rolling out.

Join the 4+ million users, and keep the JSFiddle dream alive.

  • Ad-free

    All ads in the editor and listing pages are turned completely off.

  • Use pre-released features

    You get to try and use features (like the Palette Color Generator) months before everyone else.

  • Fiddle collections

    Sort and categorize your Fiddles into multiple collections.

  • Private collections and fiddles

    You can make as many Private Fiddles, and Private Collections as you wish!

  • Console

    Debug your Fiddle with a minimal built-in JavaScript console.

JSFiddle is used by you and 4+ million other developers, in many companies ...

... and top educational institutions:

Join as PRO