Portal 2 Cheat Codes

28 cheat codes for Portal 2 on PC.

Enable Cheats (Misc)

Enables the cheat system, allowing other console commands to function. This must be entered before most other cheats.

sv_cheats 1

Open the developer console (usually by pressing `~` or `` ` ``) and type `sv_cheats 1`. You may need to enable the console in game options first.

God Mode (God Mode)

Makes your character invulnerable to all damage.

god

After enabling cheats (`sv_cheats 1`), open the console and type `god`. Type `god` again to disable.

No Clipping Mode (Misc)

Allows you to fly through walls, objects, and level geometry, disabling all collision detection.

noclip

After enabling cheats (`sv_cheats 1`), open the console and type `noclip`. Type `noclip` again to disable.

Force Portal Placement (Misc)

Removes restrictions on portal placement, allowing portals to be placed anywhere, even on invalid surfaces.

sv_portal_placement_never_fail 1

After enabling cheats (`sv_cheats 1`), open the console and type `sv_portal_placement_never_fail 1`. Use `sv_portal_placement_never_fail 0` to revert to normal.

Level Skip (Level Skip)

Instantly transports you to a different level. You must know the exact map file name.

changelevel <mapname>

After enabling cheats (`sv_cheats 1`), open the console and type `changelevel` followed by the desired map name (e.g., `changelevel sp_a1_escape`). You can use `maps *` in the console to list available maps.

Change Game Speed (Misc)

Adjusts the speed of the game. '1' is normal speed. Values greater than '1' speed up the game, while values less than '1' slow it down.

host_timescale X

After enabling cheats (`sv_cheats 1`), open the console and type `host_timescale` followed by a number (e.g., `host_timescale 0.5` for half speed, `host_timescale 2` for double speed).

Buddha Mode (God Mode)

Your character takes damage but cannot die; health will not drop below 1.

buddha

After enabling cheats (`sv_cheats 1`), open the console and type `buddha`. Type `buddha` again to disable.

God Mode (Invincibility) (God Mode)

Makes the player completely immune to all forms of damage, rendering them invincible. Re-enter the code to disable God Mode.

god

PC Only: First, enable cheats with `sv_cheats 1`. Then, open the console, type `god`, and press Enter.

Load Specific Map/Level (Level Skip)

Instantly loads and starts a specific map or level in the game. You need to know the exact map filename (e.g., `sp_a1_intro1` for the first single-player map).

map <mapname>

PC Only: First, enable cheats with `sv_cheats 1`. Then, open the console, type `map` followed by the map's filename (e.g., `map sp_a1_intro1`), and press Enter.

Give Portal Gun (Weapons)

Gives the player a Portal Gun. Useful if you lose it due to a glitch or start a map without one.

give weapon_portalgun

PC Only: First, enable cheats with `sv_cheats 1`. Then, open the console, type `give weapon_portalgun`, and press Enter.

Spawn Companion Cube (Misc)

Spawns a Weighted Companion Cube directly in front of the player.

ent_create_portal_companion_cube

PC Only: First, enable cheats with `sv_cheats 1`. Then, open the console, type `ent_create_portal_companion_cube`, and press Enter.

Spawn Storage Cube (Misc)

Spawns a standard Weighted Storage Cube directly in front of the player.

ent_create_portal_weight_box

PC Only: First, enable cheats with `sv_cheats 1`. Then, open the console, type `ent_create_portal_weight_box`, and press Enter.

Spawn Weighted Sphere (Misc)

Spawns a Weighted Sphere directly in front of the player.

ent_create_portal_weighted_sphere

PC Only: First, enable cheats with `sv_cheats 1`. Then, open the console, type `ent_create_portal_weighted_sphere`, and press Enter.

Spawn Turret (Misc)

Spawns a friendly turret directly in front of the player. This turret will not attack you.

npc_create_turret

PC Only: First, enable cheats with `sv_cheats 1`. Then, open the console, type `npc_create_turret`, and press Enter.

Third Person View (Misc)

Switches the camera to a third-person perspective. Enter `firstperson` to return to first-person view.

thirdperson

PC Only: Open the developer console, type `thirdperson`, and press Enter.

Toggle Flashlight (Misc)

Toggles the player's flashlight on or off.

impulse 100

PC Only: Open the developer console, type `impulse 100`, and press Enter.

Wireframe Mode (Misc)

Renders the game world in a wireframe view. Use `mat_wireframe 0` to disable.

mat_wireframe 1

PC Only: Open the developer console, type `mat_wireframe 1`, and press Enter. To disable, type `mat_wireframe 0` and press Enter.

Always Place Portals (Misc)

Removes restrictions on portal placement, allowing portals to be placed on any surface, including non-portal-compatible materials.

sv_portal_placement_never_fail 1

Ensure cheats are enabled with `sv_cheats 1`. Open the console, type `sv_portal_placement_never_fail 1`, and press Enter.

Spawn Cube (Misc)

Spawns a Weighted Storage Cube at your current location.

ent_create_portal_weight_box

Ensure cheats are enabled with `sv_cheats 1`. Open the console, type `ent_create_portal_weight_box`, and press Enter.

Dual Portal Gun (Weapons)

Gives the player the dual-shooting portal gun, allowing both blue and orange portals to be shot.

upgrade_portalgun

Open the developer console (`~`) and type this command after enabling cheats (`sv_cheats 1`).

Spawn Weighted Cube (Misc)

Spawns a weighted storage cube at the player's crosshair position.

ent_create_portal_weighted_cube

Open the developer console (`~`) and type this command after enabling cheats (`sv_cheats 1`). Look where you want the cube to appear.

Change Gravity (Misc)

Sets the gravity level in the game. Default is typically 600. Lower values make you jump higher, higher values increase gravity.

sv_gravity <value>

Open the developer console (`~`) and type this command after enabling cheats (`sv_cheats 1`). Replace `<value>` with your desired gravity (e.g., `sv_gravity 100` for low gravity).

No Clip Mode (God Mode)

Walk through walls and fly anywhere in the level.

sv_cheats 1; noclip

Speed Run Tip: ABH (Tips)

Face backward, jump, and hold back+duck. You accelerate faster than normal. Used in speedruns.

Accelerated Back Hopping

Portal Gun Upgrade (Unlock All)

Enables dual portal gun immediately. Open console first.

sv_cheats 1; upgrade_portalgun

Place Portal Anywhere (Unlock All)

Portals can be placed on any surface, even black panels.

sv_cheats 1; sv_portal_placement_never_fail 1

Disable Cheats (Misc)

Disables the use of most cheat commands in the game.

sv_cheats 0

PC Only: Open the developer console, type `sv_cheats 0`, and press Enter.

No Clip Mode (Fly Through Walls) (Misc)

Allows the player to fly freely through the map and pass through any solid objects or walls. Re-enter the code to disable No Clip mode.

noclip

PC Only: First, enable cheats with `sv_cheats 1`. Then, open the console, type `noclip`, and press Enter.