Trinket has shut down. What can your class use instead?
Students can run Python and Java on OnlineCompiler.io in any browser, on a Chromebook too, with no accounts and nothing to install. It does not run turtle graphics or HTML pages, and it has no class roster. This page says what a class gets, what it doesn't, and how to swap old Trinket embeds.
Também em portuguêsTambién en español
Can a class use OnlineCompiler.io instead of Trinket?
For text-based Python and Java, yes. For turtle, web pages or a class list, no. Here is the whole picture.
What a class can do today
- Run code with no student accounts. Students open the Python online compiler or the Java online compiler and press Run. Nothing to install, and it
is a website, so it works on Chromebooks, tablets and school PCs. If your web filter blocks it, ask IT to
allow
onlinecompiler.ioandapi.onlinecompiler.io. - Hand work in with a link. Share makes a link to the code that anyone can open and run, with no account. Students can paste it into Google Classroom, Teams or an email. Links made without an account last 90 days; Save keeps code for as long as the student wants it, but needs an account.
- Check answers against expected output. The online compiler with test cases runs a program against several inputs and marks each one passed or failed.
- Follow a course. GCSE Python covers how a UK class can use the editor with each exam board, and AP CSA Java does the same for AP Computer Science A.
- Put runnable examples in your own pages. The widget (below) replaces a Trinket iframe on your school site or course notes. It needs a free account for you, not for your students.
What it does not do
- No turtle, Pygame or tkinter. Programs run on a server with no screen, so they don't import. Matplotlib charts do work.
- No HTML, CSS or JavaScript page preview. JavaScript runs on Node.js, with no page to draw on.
- No class roster or teacher view of student work. There are no class lists or assignments, and the editor does not show you what each student wrote. Students hand work in as share links. If you build your own course site, problem mode can show a stored problem with its tests in your page, but your server has to create the sessions and record the scores.
- Your own embeds share your account's limits. On the free plan, a widget key takes 60 runs a minute and 32 waiting at once across all your students. A class pressing Run in the same moment can go over that; those students see a message and can press Run again a few seconds later. The pricing page lists the paid plans' limits.
- Input is typed first. Students put every answer in the Input tab, then press Run, rather than answering prompts as they appear.
If you need turtle, web pages or a roster, the tools Trinket named, such as Pickcode, Dodona and Kita, are the better fit. Pickcode's own page lists class setup, real-time views of student work and embeddable editors under its paid teacher plan, and says turtle and pygame carry over (checked 6 Nov 2026). You can also use both: one tool for turtle and classes, and this for plain Python and Java runs.
What happened
Trinket announced in January 2026 that it would stop operating, and shut down on 31 August 2026. Users could download their trinkets until then; now the site, its embeds and its content are gone, and Trinket says it can't recover them. The software was released as open source (CC0), and a community copy runs at trinket.strivemath.org without the old content. Trinket pointed teachers to Pickcode, Dodona and Kita.
Is OnlineCompiler.io the right replacement?
It replaces one part of Trinket: runnable text-based examples embedded in your own pages. Check what you used Trinket for:
| You used Trinket for | OnlineCompiler.io |
|---|---|
| Runnable Python examples on your site | Yes. Readers edit and run the code; Reset brings back yours. Python 3.14 with the standard library, plus NumPy, pandas, Matplotlib and the rest of the data science stack. |
| Java examples | Yes. Java on OpenJDK 25, plus C, C++, C#, Go, Rust and 39 more languages. |
Programs that use input() | Partly. Readers type the input in the Input tab before running, rather than answering prompts one at a time. |
| Free, with no ads or sign-in for readers | Yes. 100,000 runs a month free, including commercial use. |
| Matplotlib plots | Yes. plt.show() saves each figure, and the widget shows it under the output. |
| Turtle, Pygame or GlowScript | No. Programs run on a server with no screen, and turtle doesn't import. |
| HTML, CSS and JavaScript pages, Blocks or music | No. These are editors we don't offer. JavaScript programs run on Node.js, but there's no web page for them to draw on. |
| Classes, assignments and saved student work | No. There is no class roster or teacher view. Students hand work in as share links. Pickcode, Dodona and Kita do more here. |
| Embedding in a site that only accepts an iframe | Yes. The iframe embed carries the code in its URL. |
Swapping a Trinket embed
1. Find the dead embeds
A Trinket embed was an iframe pointing at trinket.io/embed/<language>/<id>, and the
iframe is all that is left in your pages:
<iframe src="https://trinket.io/embed/python3/a1b2c3d4e5" width="100%" height="400"
frameborder="0" marginwidth="0" marginheight="0" allowfullscreen></iframe>
<!-- Java trinkets, and any trinket with options, looked like this -->
<iframe src="https://trinket.io/embed/java/a1b2c3d4e5?start=result&showInstructions=true" width="100%" height="600"
frameborder="0" marginwidth="0" marginheight="0" allowfullscreen></iframe>Search your site, course notes or exported pages for trinket.io/embed:
# Run in the folder of your site or course notes: lists every dead Trinket embed
grep -rnoE 'trinket\.io/embed/[a-z0-9]+/[a-z0-9]+' . --include='*.html' --include='*.md' --include='*.markdown' --include='*.svelte' --include='*.mdx'2. Get the code back from somewhere
The iframe holds an id, not the program, so the code is not in your page. Trinket stored it, and Trinket says it cannot retrieve trinkets or accounts. The id is no use to us or to anyone else now. Look for the code in your own copies first: the zip you downloaded before the shutdown, your lesson plans, slides, a git repository, or students' work. We have not found a way to pull a trinket's code from the Internet Archive, and would not count on one. Where the code is gone, rewriting a short example is usually quicker than hunting for it.
3. Paste the widget in its place
The widget keeps the code in your page instead, so it can't disappear with someone else's site, and
search engines can read it. Create a widget key on the Widgets page of your dashboard, restricted to your domain,
then put the program inside the div, and paste this where the iframe was. Use your own key: the key
this site's examples run on is for these pages, not for yours, and a key restricted to your domain stops anyone
else using yours.
<!-- Once per page, or once in your site's layout -->
<script src="https://onlinecompiler.io/widget.js"></script>
<!-- Each example -->
<div class="runcode" data-key="YOUR_WIDGET_KEY" data-lang="python-3.14" data-theme="light">
<pre>
name = input("What's your name? ")
for letter in name:
print(letter.upper())
</pre>
<pre data-stdin>Ada</pre>
<a data-credit href="https://onlinecompiler.io/">Runs on OnlineCompiler.io</a>
</div>If your site or course platform takes an iframe but strips scripts, use the iframe embed instead. The
code and input travel in the part of the URL after the #, which browsers don't send to any
server. The embed builder writes the iframe for you:
<iframe src="https://api.onlinecompiler.io/embed/?key=YOUR_WIDGET_KEY&lang=python-3.14&theme=light#code=name%20%3D%20input(%22What's%20your%20name%3F%20%22)%0Afor%20letter%20in%20name%3A%0A%20%20%20%20print(letter.upper())&input=Ada"
title="Runnable Python example" width="100%" height="400" style="border: 0" loading="lazy"></iframe>
<p><a href="https://onlinecompiler.io/">Runs on OnlineCompiler.io</a></p>| Trinket embed option | Widget |
|---|---|
height | data-height, the editor's height in pixels; by default it fits the code |
outputOnly, start=result | data-readonly shows the code without letting readers edit it; output appears when they run it |
| Python or Python 3 trinket | data-lang="python-3.14" |
| Java trinket | data-lang="openjdk-25" |
| Light page | data-theme="light", or auto to follow the reader's setting |
If your pages are built with a docs tool such as MkDocs, Docusaurus or Sphinx, see runnable code examples in docs for the setup that keeps your code blocks as they are.
Python differences to expect
- Real Python 3.14. Trinket's "Python" ran Skulpt in the browser; here the code runs on CPython 3.14 on a server, with the full standard library.
- Input up front. Prompts and answers don't interleave: the output shows the prompts, and the input comes from the Input tab.
- Text and charts. Matplotlib charts show under the output (a program can also write files to
/tmp/outputs), but there's no turtle or other drawing on a screen. NumPy, pandas and the rest of the data science stack are installed; pip is there too, but runs have no network, so it can't download anything else. - Limits: each run gets 30 seconds, 512 MB of memory (up to 2 GB on Pro and above) and no internet access. That suits exercises and examples, not long simulations.
Frequently asked questions
Can I keep using an iframe, as with Trinket?
Yes. The iframe embed takes the code in its URL, so you paste one iframe per example, as you did with Trinket. Use it where your site or course platform strips script tags; elsewhere the script widget keeps the code readable in your page.
Can I get my old trinkets back?
Not from Trinket: downloads closed with the site, and Trinket says it cannot recover content or accounts. If you downloaded a zip before the shutdown, or the code is still in your course notes, you can paste it into a new embed.
Do my students need accounts?
No. Students run code and open share links with no sign-in. A student needs an account only to use Save. You need a free account only to make a widget key for embeds; runs from your own embed count against your plan, and the free plan includes 100,000 runs a month for the whole class, with commercial use allowed and no credit card.
Does it work on Chromebooks?
Yes. It is a website, so there is nothing to install. If your school filter blocks it, ask IT to allow onlinecompiler.io and api.onlinecompiler.io.
Does OnlineCompiler.io run turtle graphics?
No. Programs run on a server with no screen, so turtle, Pygame and GlowScript don't work. Matplotlib charts do: plt.show() saves each figure, and the widget shows it under the output. For turtle and other graphics, look at the replacements Trinket itself suggested, such as Pickcode.