Skip to main content

For Students: Turn On Block Coding

How to switch between block and code view on CodeHS

Written by Mary Duskwood

Blocks in CodeHS Courses

Blocks allow you to drag and drop pieces of code together instead of typing everything out. If your teacher allows blocks for your course, you can switch back and forth between "Block View" and "Code View" in the code editor. How you turn blocks on or switch views depends on which type of program you're working in:

HTML and JavaScript Karel Programs

From your code editor, click the Blocks icon in the left sidebar, then switch between Blocks and Code using the two buttons that appear:

Screenshot showing how to switch between blocks and text coding. Arrow pointing to Blocks icon in left sidebar. Another arrow pointing to Blocks and Code buttons.

When you're in Code View, the block palette is grayed out. To get back to blocks, click Blocks up top next to Code, or press Switch to Block Coding to use the palette:

Screenshot showing the two ways to switch back to Block coding from Code view

If your teacher has turned on block coding for you, you can enable coding with blocks by default for HTML/JavaScript Karel programs. You can do this by clicking the gear icon in the left sidebar of the code editor, and toggle on Code with blocks by default:

Image showing how students can enable block coding by default by toggling "Code with blocks by default"

Coding in Art/Music/Sports Programs

If blocks are allowed, you will see a dropdown menu next to the Share button in the top right of the code editor. You can use this dropdown menu to switch between block coding and regular text coding:

GIF demonstrating how to switch between block and text coding in music/art/sports programs

Python Turtle (Blocks) Programs

You can use block coding for Python Turtle programs in the sandbox (not available in Python Turtle Assignments).

To do this, Go to the Block Coding filter and select Python Turtle (Blocks) when creating your sandbox program.

Image demonstrating how to create a Python Turtle (Blocks) program

Note: switching to text coding isn't an option for "Python Turtle (Blocks)" Sandbox programs

Can I ask my teacher to enable blocks?

You can reach out to your teacher to ask if they can enable blocks by going to More > Conversation near the top-right corner of your code editor.

Here, you can ask them to enable blocks for the assignment you're working on:

Image showing more>conversations to message your teacher

Blocks in the CodeHS Sandbox

Even if your CodeHS course does not allow blocks, you can use blocks in Sandbox programs.

Blocks are available for the following languages/Sandbox program types:

  • Karel in JavaScript

  • HTML

  • Coding in Art, Music, or Sports

  • Python Turtle (Blocks) Sandbox programs

To create a block coding sandbox program, choose Block Coding under "Choose a Language," then pick your program type. These programs will open with block coding enabled.

GIF demonstrating how to create a sandbox block coding program

If you have an already-existing HTML/JavaScript Karel program and would like to turn on block coding, click the gear icon in the left sidebar and toggle Use block coding (you'll have to refresh to see the changes):

GIF demonstrating how to enable block coding for a sandbox program


Still have questions? Ask your teacher!

Did this answer your question?