Draw a straight (and dotted) line in Photoshop with the Pen Tool
Learn the quickest way to draw straight and dotted lines in Photoshop using the Pen Tool in Shape mode. You’ll set stroke color and weight, choose cap styles, and optionally create dotted lines with custom dash and gap settings.

Step-by-step instructions
Start a new document
Go to File → New and set your canvas size.
Click Create.
Select the Pen Tool and configure stroke
Press P to select the Pen Tool.
In the options bar, set Mode to Shape, Fill to None, and pick a Stroke color (e.g., black).
Set Stroke Weight to your desired thickness.
Draw a straight line
Click once to place the first anchor point.
Click again at a second location to create a straight line segment.
Adjust the stroke thickness and choose a cap style (Round or Square) in the stroke options.
Create a dotted line (optional)
With the line’s shape layer selected, open Stroke settings → More Options.
Enable dashed line and input: 2 (dash), 1 (gap), 3 (dash), 2 (gap).
Set Cap to Round for a smoother dotted appearance, then click OK.
Start another line (optional)
Deselect the current shape layer by clicking an empty area in the Layers panel.
Repeat the steps above to draw additional straight or dotted lines.