Locomotion facilitates behaviour and its underlying physiological mechanisms may therefore impact behavioural phenotypes. Metabolism is often thought to modulate locomotion and behaviour, but empirical support for this suggestion is equivocal. Muscle contractile function is directly associated with locomotion. Here, we test the hypotheses that muscle mechanics determine locomotor performance and activity in zebrafish (Danio rerio) and thereby also affect risk-taking behaviour. We show that there is a mechanistic link between muscle performance and behaviour by manipulating muscle contractile properties, which caused proportional changes in critical sustained swimming performance and, in an open arena, voluntary swimming speed, the proportion of time fish were active, and the latency to move. We modelled the relationships between muscle contractile properties, swimming performance, activity and behaviour with a partial least-squares path model. The latent variable ‘muscle’, formed by isolated muscle force production, stress, fatigue resistance and activation and relaxation rates, had a significant positive effect on swimming performance (‘swim’ reflected in sustained and sprint speeds). Together, muscle and swim had a significant positive effect on activity, and explained 71.8% of variation in the distance moved, time active and maximum voluntary speed in an open field. Activity had a significant positive effect on boldness, explaining 76.0% of variation in latencies to move and to approach a novel object. Muscle contractile function determines voluntary movement and we suggest that exploration and dispersal are functions of physiological and mechanical optimisation. Boldness therefore may be partly explained by the greater likelihood of faster fish to move further and encounter novel objects and conspecifics more quickly as a result.