Do I have to give the police my name?

There is no overall requirement to provide your name to a police officer when asked, unless you are stopped as the driver of a vehicle or if the officer makes it clear he intends to report you for an offence or issue a penalty notice.

Further to this, if an officer intends to report you for anti social behaviour under s52 of the Police Reform Act 2002, you are obliged to provide your details upon request.
The police do not have the authority to randomly stop check people on foot and request their details, regardless of whether that officer wishes to check your details to find out if you are ‘known to the police’. Even if you are stopped and searched, or issued with a dispersal notice, you are under no obligation to give your details to the police.

If an officer refuses to allow you to leave the scene, when you are on foot, and you have not been arrested or you are not being stopped and searched, then they would be committing false imprisonment. If they make threats to arrest you, when you are under no legal obligation to provide your details, this could be considered assault.

If you ever find yourself stopped by a police officer or a PCSO, who make a request for details, ask them which law they are acting under. If they fail to respond appropriately, you have the right to refuse.