At some point in any video and motion graphic project, you will probably need to figure out how to make a typewriter text animation with cursor. And it may surprise you to know that it is not as easy as it seems. For that reason, I have decided to write this blog so no one has to spend hours making a typing text animation in After Effects.
In this post, I will show you multiple methods to make a typewriter effects animation with and without a blinking cursor and provide the After Effects projects template and presets for free. I completely understand that sometimes you don’t have the time or luxury to even watch a tutorial and you need to get your project out the door. I have been in this situation, so I am here offering the shortcut. If you find this helpful and informative, please like the page 🙂
Let’s start with the basics for the beginners. Here the simplest and fastest way to create a typewriter effect in After Effects without a cursor. Follow these steps- it takes only 20 seconds.
Create a new composition
Click on the T icon and type your text
Open Effects & Presets window
Search the “Typewriter” presets
Select Typewriter and drag to your text
Boom! If you press play, the text should animate with the typing animation
To achieve this After Effects type animation with a cursor, we actually won’t use the default typewriter presets just because the expression is much more powerful than the regular typewriter preset. This whole article is based on my research online, so if you are the programmer of this awesome After Effects typewriter with cursor expression, I’ll be happy to link this blog to your website and give you the proper credit.
Demo of the typewriting animation with cursor below
I have created 4 ways to learn this After Effects typing effect. Just choose the one that best fits you.
Instructions
Video Tutorial
Free After Effects project file (at the end of this article)
Free typewriter with cursor preset (at the end of this article)
Instructions
Create a new composition
Select T (Horizontal Type Tool CTRL+T)
Type your text
Open the Effects & Presets windows
Search for Slider Control
Drag and drop Slider control on your text layer
Rename the slider control to Speed
Go to Source Text
Alt click on the Stop Watch icon to add a expression
Copy and paste this expression
L = text.sourceText.length;
It = time – thisLayer.inPoint;
T = It*effect(“Speed”)(“Slider”);
F = Math.round( It % 1);if(F==1 |(T0)){Fl=”|”;}else{Fl=” “;}substr(0,T) + Fl
Increase the slider control speed (this defines how fast the text is typing)
Press Play and you should see you your text typing with the blinking cursor
Adding color to the cursor of this typing animation is actually easy once you know where to add the expression.
Demo of the typewriter animation with blinking colored cursor below
Below I have created 4 ways to learn this After Effects typing effect with a colored cursor. Just choose the one that works best for you.
Instructions
Video Tutorial
After Effects project file (at the end of this article)
Typewriter with with color cursor preset (at the end of this article)
Instructions
Create a new composition
Select T (Horizontal Type Tool CTRL+T)
Type your text
Open the Effects & Presets windows
Search for Slider Control
Drag and drop Slider control on your text layer
Rename the slider control to Speed
Go to Source Text
Alt click on the Stop Watch icon to add a expression
Copy and paste this expression
L = text.sourceText.length;
It = time – thisLayer.inPoint;
T = It*effect(“Speed”)(“Slider”);
F = Math.round( It % 1);if(F==1 |(T0)){Fl=”|”;}else{Fl=” “;}substr(0,T) + Fl
Increase the slider control speed to 20 (this defines how fast the text is typing)
Now if you  press play, you should see you your text typing with the blinking cursor
Let’s make the blinking cursor bar a different color
Click on the animate arrow and choose Fill > RGB
Expand Range Selector 1
Alt click on the Start stop watch and add this expression below: text.animator(“Animator 1”).selector(“Range Selector 1”).end-1
Alt click on the End stop watch and add this expression below: text.sourceText.length
Expand Advanced
Change unit from Percentage to Index
Now play. You should the the text typing with a red blinking cursor color.
Obviously now you can change the cursor to a different color by changing the Fill Color
Video Tutorial
Download Free After Effects typewriter project template file below
Hi,
I just tried it buts its been giving me an error message.. ” Expression disabled. Error at line 2 in property ‘source text’ of layer 1… syntax error”
I had the same issue but I think this comes up if you’re not using the latest version of AE. I was using CS6 and thus ran into this issue. I downloaded a free trial of CC and it worked.
I had to retype the entire thing in notepad or something similar so that it didn’t use special characters. All the quotation marks, semi-colons, etc are pasting in as unicode characters that breaks the expression. Pasting in the comments like the user below also changes the characters to special ones that break it. Just in case anyone else has this issue!
Some wrong “-” signs and quotes have crept their way into the sample code. Maybe the blog software? This worked for me: L = text.sourceText.length;
It = time – thisLayer.inPoint;
T = It*effect(“Speed”)(“Slider”);
F = Math.round( It % 1);
if(F==1){
Fl=”|”;}
else{
Fl=””;}
substr(0,T) + Fl;
Guys thanks so much for helping, please get the latest version of After Effects, I had no error when I have uploaded these files. If you get an expression error it might be either your after effects version or the language, I haven’t use universal expression for these files. Hope this help. Good Luck
hello, thanks for creating this. You helped me out a lot…
Is there a way to make the blinking line thinner? for example if the font is in medium, what expression would I write to use a light font for the blinking or even, make the blinking 50% opacity?
Anyways, if I don’t hear from you. I still very much appreciated your generosity. Lia
The updated script here worked with cc2018.
L = text.sourceText.length;
It = time – thisLayer.inPoint;
T = It*effect(“Speed”)(“Slider”);
F = Math.round( It%1);
if(F==1 | (T0)){Fl = “|”;} else{Fl=” “;}
substr(0,T) + Fl?
I’ve tried everyone’s code on the latest AE but keep getting syntax errors…. can someone post a screenshot of the code? Maybe this blog site’s coding is messing up the syntax?
I copied this from the youtube video, looks like something was left out there. Also, re-type the ‘quotation marks’ if you still get the error. After effects version had nothing to do with the error.
L = text.sourceText.length;
It = time – thisLayer.inPoint;
T = It*effect(“Speed”)(“Slider”);
F = Math.round( It % 1);
if(F==1 |(T0)){Fl=”|”;}else{Fl=” “;}
substr(0,T) + Fl
How can you make the cursor keeps the same color in different lines
It only has his own color in the first line
The next lines it changes to the text color
L = text.sourceText.length;
It = time – thisLayer.inPoint;
T = It*effect(“Speed”)(“Schieberegler”);
F = Math.round( It % 1);
if(F==1|(T,0)){Fl=”|”;}else{Fl=” “;}
substr(0,T) + Fl
Hi! I have a question. When the cursor blinks when the text is completed, the whole sentence moves left and right each time it blinks. Does anyone know how to fix this? Thanks 🙂
The last code here in the comments worked for me, thanks.
Question: Is it possible to use this with text having varied font size, kerning, leading, etc? Right now all text takes these characteristics from the first character.
The expression in “Typewriting effect with cursor” instructions is different compared to the one in video attached at the tail end. The youtube video expression works 100% for me and didn’t give me syntax errors like the instructions. I’ve pasted the youtube expression below:
L = text.sourceText.length;
It = time – thisLayer.inPoint;
T = It*effect(“Speed”)(“Slider”);
F = Math.round( It % 1);
Does anyone knows how to hold the typewriting and continue, basically if I reduce the speed to 0, but the typing goes back to the start. I only want it paused.
Hi,
I just tried it buts its been giving me an error message.. ” Expression disabled. Error at line 2 in property ‘source text’ of layer 1… syntax error”
same here. how to fix it
I had the same issue but I think this comes up if you’re not using the latest version of AE. I was using CS6 and thus ran into this issue. I downloaded a free trial of CC and it worked.
I had to retype the entire thing in notepad or something similar so that it didn’t use special characters. All the quotation marks, semi-colons, etc are pasting in as unicode characters that breaks the expression. Pasting in the comments like the user below also changes the characters to special ones that break it. Just in case anyone else has this issue!
how to apply typing effect in blogger any body help me?
Some wrong “-” signs and quotes have crept their way into the sample code. Maybe the blog software? This worked for me: L = text.sourceText.length;
It = time – thisLayer.inPoint;
T = It*effect(“Speed”)(“Slider”);
F = Math.round( It % 1);
if(F==1){
Fl=”|”;}
else{
Fl=””;}
substr(0,T) + Fl;
Guys thanks so much for helping, please get the latest version of After Effects, I had no error when I have uploaded these files. If you get an expression error it might be either your after effects version or the language, I haven’t use universal expression for these files. Hope this help. Good Luck
hello, thanks for creating this. You helped me out a lot…
Is there a way to make the blinking line thinner? for example if the font is in medium, what expression would I write to use a light font for the blinking or even, make the blinking 50% opacity?
Anyways, if I don’t hear from you. I still very much appreciated your generosity. Lia
The updated script here worked with cc2018.
L = text.sourceText.length;
It = time – thisLayer.inPoint;
T = It*effect(“Speed”)(“Slider”);
F = Math.round( It%1);
if(F==1 | (T0)){Fl = “|”;} else{Fl=” “;}
substr(0,T) + Fl?
_________________________________________________
I wonder the same thing!
I’m on the latest AE and have tried pasting all of your codes but to no avail! Any ideas?
I’ve tried everyone’s code on the latest AE but keep getting syntax errors…. can someone post a screenshot of the code? Maybe this blog site’s coding is messing up the syntax?
I copied this from the youtube video, looks like something was left out there. Also, re-type the ‘quotation marks’ if you still get the error. After effects version had nothing to do with the error.
L = text.sourceText.length;
It = time – thisLayer.inPoint;
T = It*effect(“Speed”)(“Slider”);
F = Math.round( It % 1);
if(F==1 |(T0)){Fl=”|”;}else{Fl=” “;}
substr(0,T) + Fl
CAME ON !!!!!!!!! ALMOST 2 hours to solve the problem …………
GUYS SPEED and Speed are not the same … USE CAPITAL LETTERS FOR VARIABLES CHANGED MY MIND
How can you make the cursor keeps the same color in different lines
It only has his own color in the first line
The next lines it changes to the text color
My text just disappears, what steps am I missing?
Guys, try this expression:
L = text.sourceText.length;
It = time – thisLayer.inPoint;
T = It*effect(“Speed”)(“Schieberegler”);
F = Math.round( It % 1);
if(F==1|(T,0)){Fl=”|”;}else{Fl=” “;}
substr(0,T) + Fl
Hi! I have a question. When the cursor blinks when the text is completed, the whole sentence moves left and right each time it blinks. Does anyone know how to fix this? Thanks 🙂
For those of you struggling, I’ve found the bug in the code. The code listed here includes the text “T0” in the F line, but it needs to read “T,0”
This should work: https://jsfiddle.net/wfhben9p/3/#&togetherjs=PdKJj4Ow1i
CB Thanks
Thank you so much!!!
Thank you! Finally got it to work with your code!
Thank you so much! Works for me!
Oh my thank you CB, it worked!
That was awesome
last one was the only one that worked for me! code was:
L = text.sourceText.length;
It = time – thisLayer.inPoint;
T = It * effect(“Speed”)(“Slider”);
F = Math.round(It % 1);
if (F == 1 | (T, 0)) {
Fl = “|”;
} else {
Fl = ” “;
}
substr(0, T) + Fl
The expression code is different between the text instructions and the video. If you are having problems look at the difference between the two.
The last code here in the comments worked for me, thanks.
Question: Is it possible to use this with text having varied font size, kerning, leading, etc? Right now all text takes these characteristics from the first character.
can we increase the cursor size only?
Reference error: Substr is not defined
The expression in “Typewriting effect with cursor” instructions is different compared to the one in video attached at the tail end. The youtube video expression works 100% for me and didn’t give me syntax errors like the instructions. I’ve pasted the youtube expression below:
L = text.sourceText.length;
It = time – thisLayer.inPoint;
T = It*effect(“Speed”)(“Slider”);
F = Math.round( It % 1);
if(F==1 |(T0)){Fl= “|”;}else{Fl=” “;}
substr(0,T) + Fl
Does anyone knows how to hold the typewriting and continue, basically if I reduce the speed to 0, but the typing goes back to the start. I only want it paused.
is it possible to play the script backwards after being executed in the place.
Thank you for your help
Great idea! I tried all of the above, but never worked for me using AE 2021 (18.4.6).