In connection with digitalisation, algorithms are technical rules that are increasingly competing with law as a means for controlling behaviour. They can support, modify, or thwart the validity of law. In combination with the opportunities associated with artificial intelligence, algorithms are particularly important with respect to the handling of big data. For instance, predictive analytics use big data to identify emerging trends and patterns of behaviour and predict future behaviour. The aim of prescriptive analytics is to create strategies in order, e.g. to influence attitudes, behaviours, and social developments. Their use is associated with opportunities for the social construction of reality, knowledge, values, and attitudes and thus, with the ability to influence individual behaviour, the way public opinion is formed, and political elections. They offer considerable potential for manipulation. Since selection and control made by algorithms complements and competes with legal control of behaviour, it is important to recognise the differences between technical and legal regulation. The article addresses the special features of the types of rules and of the process for generating and applying technical and legal rules. In contrast to law that is enacted and applied at the sovereign level, the development and use of algorithms by private actors, particularly globally operating enterprises, is generally not the result of a process that is governed by the rule of law, nor is it one that is usually transparent and subject to public scrutiny. In addition, rule enforcement is changing. If an individual's behavioural options are limited by the technology itself, whether control is successful no longer depends on awareness of the rules by those affected. Control is then no longer based on »I am allowed«, »I am not allowed«, or »I should«, which are the typical requirements for the way law works, meaning that no autonomous decision is made about rule compliance. Rather, compliance is achieved directly by limiting the actual »I can«. Such rules are self-executing. The article concludes with an overview of suggestions as to how the opportunities associated with digitalisation can be exploited without jeopardising fundamental freedoms and the realisation of other interests in the common good.